{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 注意力 Nadaraya-Watson 核回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch\n",
    "import d2lzh_pytorch as d2l\n",
    "from torch import nn"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 生成数据集\n",
    "\n",
    "简单起见，考虑下面这个回归问题：给定的成对的 输入——输出 数据集${\\{(x_1,y_1),...,(x_n,y_n)\\}}$，如何学习 ${f}$ 来预测任意新输入${x}$的输出 ${\\hat{y}=f(x)}$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "根据下面的非线性函数生成一个人工数据集，其中加入的噪声项为 ${ \\epsilon }$\n",
    "\n",
    "公式为${y_i = 2\\sin(x_i) + x_i^{0.8} + \\epsilon,}$\n",
    "\n",
    "其中${ \\epsilon }$ 服从均值为0和标准差为0.5的正态分布。我们生成了50个训练样本和50个测试样本。为了更好地可视化之后的注意力模式，输入的训练样本将进行排序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "50"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def f(x):\n",
    "    return 2*torch.sin(x) + x**0.8\n",
    "\n",
    "n_train=50 # 训练样本数\n",
    "\n",
    "# 训练样本的输入\n",
    "x_train,_=torch.sort(torch.rand(n_train)*5) \n",
    "\n",
    "# 训练样本的输出\n",
    "y_train=f(x_train)+torch.normal(0.0,0.5,(n_train,)) \n",
    "\n",
    "# 测试样本的输入\n",
    "x_test=torch.arange(0,5,0.1) \n",
    "\n",
    "# 测试样本的真实输出\n",
    "y_truth=f(x_test)  \n",
    "\n",
    "# 测试样本数 \n",
    "n_test=len(x_test) \n",
    "\n",
    "n_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([4.9185, 1.8402, 0.5761, 1.0706, 1.7015, 0.7946, 2.5644, 0.3526, 3.3762,\n",
       "        2.5308, 4.0966, 0.1410, 4.5084, 3.0437, 1.6944, 2.6473, 4.4952, 2.9850,\n",
       "        4.4509, 1.9200, 0.4503, 3.8884, 1.4709, 1.9405, 4.4023, 0.1990, 3.5748,\n",
       "        0.4806, 4.1094, 2.8285, 3.2306, 1.6590, 3.9963, 2.5323, 1.6531, 0.6692,\n",
       "        4.4009, 3.3692, 1.6434, 3.7298, 2.7565, 0.1729, 2.0364, 1.7678, 2.3322,\n",
       "        2.0467, 3.4504, 0.7237, 4.5185, 0.1905])"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "torch.rand(n_train)*5"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "下面的函数将绘制的所有训练样本\n",
    "\n",
    "* 样本由圆圈表示\n",
    "* 不带噪声项的真实数据生成函数f（标记为 Truth）\n",
    "* 学习得到的预测函数（标记为 Pred）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plot_kernel_reg(y_hat):\n",
    "    d2l.plot(x_test, [y_truth, y_hat], 'x', 'y', legend=['Truth', 'Pred'],\n",
    "            xlim=[0, 5], ylim=[-1, 5])\n",
    "    d2l.plt.plot(x_train, y_train, 'o', alpha=0.5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 平均汇聚\n",
    "\n",
    "先使用可能是这个世界上“最愚蠢”的估计器来解决回归问题：基于平均汇聚来计算所有训练样本输出值的平均值："
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "${f(x) = \\frac{1}{n}\\sum_{i=1}^n y_i,}$ \n",
    "\n",
    "如下图所示，这个估计确实不够聪明。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"184.455469pt\" version=\"1.1\" viewBox=\"0 0 248.301563 184.455469\" width=\"248.301563pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n   <cc:Work>\r\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n    <dc:date>2021-11-26T11:00:51.043415</dc:date>\r\n    <dc:format>image/svg+xml</dc:format>\r\n    <dc:creator>\r\n     <cc:Agent>\r\n      <dc:title>Matplotlib v3.3.4, https://matplotlib.org/</dc:title>\r\n     </cc:Agent>\r\n    </dc:creator>\r\n   </cc:Work>\r\n  </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n  <g id=\"patch_1\">\r\n   <path d=\"M 0 184.455469 \r\nL 248.301563 184.455469 \r\nL 248.301563 -0 \r\nL 0 -0 \r\nz\r\n\" style=\"fill:none;\"/>\r\n  </g>\r\n  <g id=\"axes_1\">\r\n   <g id=\"patch_2\">\r\n    <path d=\"M 42.620312 146.899219 \r\nL 237.920313 146.899219 \r\nL 237.920313 10.999219 \r\nL 42.620312 10.999219 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n   </g>\r\n   <g id=\"matplotlib.axis_1\">\r\n    <g id=\"xtick_1\">\r\n     <g id=\"line2d_1\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 42.620312 146.899219 \r\nL 42.620312 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_2\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL 0 3.5 \r\n\" id=\"m518bbc1f92\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m518bbc1f92\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_1\">\r\n      <!-- 0 -->\r\n      <g transform=\"translate(39.439062 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 31.78125 66.40625 \r\nQ 24.171875 66.40625 20.328125 58.90625 \r\nQ 16.5 51.421875 16.5 36.375 \r\nQ 16.5 21.390625 20.328125 13.890625 \r\nQ 24.171875 6.390625 31.78125 6.390625 \r\nQ 39.453125 6.390625 43.28125 13.890625 \r\nQ 47.125 21.390625 47.125 36.375 \r\nQ 47.125 51.421875 43.28125 58.90625 \r\nQ 39.453125 66.40625 31.78125 66.40625 \r\nz\r\nM 31.78125 74.21875 \r\nQ 44.046875 74.21875 50.515625 64.515625 \r\nQ 56.984375 54.828125 56.984375 36.375 \r\nQ 56.984375 17.96875 50.515625 8.265625 \r\nQ 44.046875 -1.421875 31.78125 -1.421875 \r\nQ 19.53125 -1.421875 13.0625 8.265625 \r\nQ 6.59375 17.96875 6.59375 36.375 \r\nQ 6.59375 54.828125 13.0625 64.515625 \r\nQ 19.53125 74.21875 31.78125 74.21875 \r\nz\r\n\" id=\"DejaVuSans-48\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_2\">\r\n     <g id=\"line2d_3\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 81.680312 146.899219 \r\nL 81.680312 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_4\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"81.680312\" xlink:href=\"#m518bbc1f92\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_2\">\r\n      <!-- 1 -->\r\n      <g transform=\"translate(78.499062 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 12.40625 8.296875 \r\nL 28.515625 8.296875 \r\nL 28.515625 63.921875 \r\nL 10.984375 60.40625 \r\nL 10.984375 69.390625 \r\nL 28.421875 72.90625 \r\nL 38.28125 72.90625 \r\nL 38.28125 8.296875 \r\nL 54.390625 8.296875 \r\nL 54.390625 0 \r\nL 12.40625 0 \r\nz\r\n\" id=\"DejaVuSans-49\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_3\">\r\n     <g id=\"line2d_5\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 120.740313 146.899219 \r\nL 120.740313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_6\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"120.740313\" xlink:href=\"#m518bbc1f92\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_3\">\r\n      <!-- 2 -->\r\n      <g transform=\"translate(117.559062 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 19.1875 8.296875 \r\nL 53.609375 8.296875 \r\nL 53.609375 0 \r\nL 7.328125 0 \r\nL 7.328125 8.296875 \r\nQ 12.9375 14.109375 22.625 23.890625 \r\nQ 32.328125 33.6875 34.8125 36.53125 \r\nQ 39.546875 41.84375 41.421875 45.53125 \r\nQ 43.3125 49.21875 43.3125 52.78125 \r\nQ 43.3125 58.59375 39.234375 62.25 \r\nQ 35.15625 65.921875 28.609375 65.921875 \r\nQ 23.96875 65.921875 18.8125 64.3125 \r\nQ 13.671875 62.703125 7.8125 59.421875 \r\nL 7.8125 69.390625 \r\nQ 13.765625 71.78125 18.9375 73 \r\nQ 24.125 74.21875 28.421875 74.21875 \r\nQ 39.75 74.21875 46.484375 68.546875 \r\nQ 53.21875 62.890625 53.21875 53.421875 \r\nQ 53.21875 48.921875 51.53125 44.890625 \r\nQ 49.859375 40.875 45.40625 35.40625 \r\nQ 44.1875 33.984375 37.640625 27.21875 \r\nQ 31.109375 20.453125 19.1875 8.296875 \r\nz\r\n\" id=\"DejaVuSans-50\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_4\">\r\n     <g id=\"line2d_7\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 159.800313 146.899219 \r\nL 159.800313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_8\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"159.800313\" xlink:href=\"#m518bbc1f92\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_4\">\r\n      <!-- 3 -->\r\n      <g transform=\"translate(156.619063 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 40.578125 39.3125 \r\nQ 47.65625 37.796875 51.625 33 \r\nQ 55.609375 28.21875 55.609375 21.1875 \r\nQ 55.609375 10.40625 48.1875 4.484375 \r\nQ 40.765625 -1.421875 27.09375 -1.421875 \r\nQ 22.515625 -1.421875 17.65625 -0.515625 \r\nQ 12.796875 0.390625 7.625 2.203125 \r\nL 7.625 11.71875 \r\nQ 11.71875 9.328125 16.59375 8.109375 \r\nQ 21.484375 6.890625 26.8125 6.890625 \r\nQ 36.078125 6.890625 40.9375 10.546875 \r\nQ 45.796875 14.203125 45.796875 21.1875 \r\nQ 45.796875 27.640625 41.28125 31.265625 \r\nQ 36.765625 34.90625 28.71875 34.90625 \r\nL 20.21875 34.90625 \r\nL 20.21875 43.015625 \r\nL 29.109375 43.015625 \r\nQ 36.375 43.015625 40.234375 45.921875 \r\nQ 44.09375 48.828125 44.09375 54.296875 \r\nQ 44.09375 59.90625 40.109375 62.90625 \r\nQ 36.140625 65.921875 28.71875 65.921875 \r\nQ 24.65625 65.921875 20.015625 65.03125 \r\nQ 15.375 64.15625 9.8125 62.3125 \r\nL 9.8125 71.09375 \r\nQ 15.4375 72.65625 20.34375 73.4375 \r\nQ 25.25 74.21875 29.59375 74.21875 \r\nQ 40.828125 74.21875 47.359375 69.109375 \r\nQ 53.90625 64.015625 53.90625 55.328125 \r\nQ 53.90625 49.265625 50.4375 45.09375 \r\nQ 46.96875 40.921875 40.578125 39.3125 \r\nz\r\n\" id=\"DejaVuSans-51\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-51\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_5\">\r\n     <g id=\"line2d_9\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 198.860313 146.899219 \r\nL 198.860313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_10\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"198.860313\" xlink:href=\"#m518bbc1f92\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_5\">\r\n      <!-- 4 -->\r\n      <g transform=\"translate(195.679063 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 37.796875 64.3125 \r\nL 12.890625 25.390625 \r\nL 37.796875 25.390625 \r\nz\r\nM 35.203125 72.90625 \r\nL 47.609375 72.90625 \r\nL 47.609375 25.390625 \r\nL 58.015625 25.390625 \r\nL 58.015625 17.1875 \r\nL 47.609375 17.1875 \r\nL 47.609375 0 \r\nL 37.796875 0 \r\nL 37.796875 17.1875 \r\nL 4.890625 17.1875 \r\nL 4.890625 26.703125 \r\nz\r\n\" id=\"DejaVuSans-52\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_6\">\r\n     <g id=\"line2d_11\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 237.920313 146.899219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_12\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"237.920313\" xlink:href=\"#m518bbc1f92\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_6\">\r\n      <!-- 5 -->\r\n      <g transform=\"translate(234.739063 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 10.796875 72.90625 \r\nL 49.515625 72.90625 \r\nL 49.515625 64.59375 \r\nL 19.828125 64.59375 \r\nL 19.828125 46.734375 \r\nQ 21.96875 47.46875 24.109375 47.828125 \r\nQ 26.265625 48.1875 28.421875 48.1875 \r\nQ 40.625 48.1875 47.75 41.5 \r\nQ 54.890625 34.8125 54.890625 23.390625 \r\nQ 54.890625 11.625 47.5625 5.09375 \r\nQ 40.234375 -1.421875 26.90625 -1.421875 \r\nQ 22.3125 -1.421875 17.546875 -0.640625 \r\nQ 12.796875 0.140625 7.71875 1.703125 \r\nL 7.71875 11.625 \r\nQ 12.109375 9.234375 16.796875 8.0625 \r\nQ 21.484375 6.890625 26.703125 6.890625 \r\nQ 35.15625 6.890625 40.078125 11.328125 \r\nQ 45.015625 15.765625 45.015625 23.390625 \r\nQ 45.015625 31 40.078125 35.4375 \r\nQ 35.15625 39.890625 26.703125 39.890625 \r\nQ 22.75 39.890625 18.8125 39.015625 \r\nQ 14.890625 38.140625 10.796875 36.28125 \r\nz\r\n\" id=\"DejaVuSans-53\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_7\">\r\n     <!-- x -->\r\n     <g transform=\"translate(137.310937 175.175781)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 54.890625 54.6875 \r\nL 35.109375 28.078125 \r\nL 55.90625 0 \r\nL 45.3125 0 \r\nL 29.390625 21.484375 \r\nL 13.484375 0 \r\nL 2.875 0 \r\nL 24.125 28.609375 \r\nL 4.6875 54.6875 \r\nL 15.28125 54.6875 \r\nL 29.78125 35.203125 \r\nL 44.28125 54.6875 \r\nz\r\n\" id=\"DejaVuSans-120\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-120\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"matplotlib.axis_2\">\r\n    <g id=\"ytick_1\">\r\n     <g id=\"line2d_13\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 42.620312 146.899219 \r\nL 237.920313 146.899219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_14\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL -3.5 0 \r\n\" id=\"mdfb77f096e\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mdfb77f096e\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_8\">\r\n      <!-- −1 -->\r\n      <g transform=\"translate(20.878125 150.698437)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 10.59375 35.5 \r\nL 73.1875 35.5 \r\nL 73.1875 27.203125 \r\nL 10.59375 27.203125 \r\nz\r\n\" id=\"DejaVuSans-8722\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-49\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_2\">\r\n     <g id=\"line2d_15\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 42.620312 124.249219 \r\nL 237.920313 124.249219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_16\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mdfb77f096e\" y=\"124.249219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_9\">\r\n      <!-- 0 -->\r\n      <g transform=\"translate(29.257812 128.048437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_3\">\r\n     <g id=\"line2d_17\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 42.620312 101.599219 \r\nL 237.920313 101.599219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_18\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mdfb77f096e\" y=\"101.599219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_10\">\r\n      <!-- 1 -->\r\n      <g transform=\"translate(29.257812 105.398437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_4\">\r\n     <g id=\"line2d_19\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 42.620312 78.949219 \r\nL 237.920313 78.949219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_20\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mdfb77f096e\" y=\"78.949219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_11\">\r\n      <!-- 2 -->\r\n      <g transform=\"translate(29.257812 82.748437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_5\">\r\n     <g id=\"line2d_21\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 42.620312 56.299219 \r\nL 237.920313 56.299219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_22\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mdfb77f096e\" y=\"56.299219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_12\">\r\n      <!-- 3 -->\r\n      <g transform=\"translate(29.257812 60.098437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-51\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_6\">\r\n     <g id=\"line2d_23\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 42.620312 33.649219 \r\nL 237.920313 33.649219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_24\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mdfb77f096e\" y=\"33.649219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_13\">\r\n      <!-- 4 -->\r\n      <g transform=\"translate(29.257812 37.448437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_7\">\r\n     <g id=\"line2d_25\">\r\n      <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 42.620312 10.999219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_26\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mdfb77f096e\" y=\"10.999219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_14\">\r\n      <!-- 5 -->\r\n      <g transform=\"translate(29.257812 14.798437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_15\">\r\n     <!-- y -->\r\n     <g transform=\"translate(14.798437 81.908594)rotate(-90)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 32.171875 -5.078125 \r\nQ 28.375 -14.84375 24.75 -17.8125 \r\nQ 21.140625 -20.796875 15.09375 -20.796875 \r\nL 7.90625 -20.796875 \r\nL 7.90625 -13.28125 \r\nL 13.1875 -13.28125 \r\nQ 16.890625 -13.28125 18.9375 -11.515625 \r\nQ 21 -9.765625 23.484375 -3.21875 \r\nL 25.09375 0.875 \r\nL 2.984375 54.6875 \r\nL 12.5 54.6875 \r\nL 29.59375 11.921875 \r\nL 46.6875 54.6875 \r\nL 56.203125 54.6875 \r\nz\r\n\" id=\"DejaVuSans-121\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-121\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"line2d_27\">\r\n    <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 42.620312 124.249219 \r\nL 46.526313 116.136982 \r\nL 50.432313 108.999323 \r\nL 54.338313 102.217148 \r\nL 58.244313 95.726379 \r\nL 62.150312 89.522233 \r\nL 66.056313 83.619087 \r\nL 69.962312 78.038824 \r\nL 73.868313 72.806 \r\nL 77.774314 67.945395 \r\nL 81.680312 63.480584 \r\nL 85.586313 59.432954 \r\nL 89.492314 55.821098 \r\nL 93.398311 52.660258 \r\nL 97.304312 49.962036 \r\nL 101.210313 47.734078 \r\nL 105.116313 45.979911 \r\nL 109.022314 44.69881 \r\nL 112.928315 43.885737 \r\nL 116.834312 43.531371 \r\nL 120.740313 43.622105 \r\nL 124.646309 44.140188 \r\nL 128.552314 45.063873 \r\nL 132.458311 46.367563 \r\nL 136.364316 48.022135 \r\nL 140.270312 49.995107 \r\nL 144.176318 52.251038 \r\nL 148.082314 54.751808 \r\nL 151.98832 57.457039 \r\nL 155.894316 60.324422 \r\nL 159.800313 63.310193 \r\nL 163.706318 66.369546 \r\nL 167.612314 69.45704 \r\nL 171.518311 72.527086 \r\nL 175.424316 75.534393 \r\nL 179.330312 78.434371 \r\nL 183.236318 81.183652 \r\nL 187.142314 83.740416 \r\nL 191.048311 86.06491 \r\nL 194.954316 88.119776 \r\nL 198.860313 89.870412 \r\nL 202.766309 91.285368 \r\nL 206.672305 92.336626 \r\nL 210.57832 92.999866 \r\nL 214.484316 93.254719 \r\nL 218.390312 93.084986 \r\nL 222.296309 92.478756 \r\nL 226.202305 91.428572 \r\nL 230.10832 89.931453 \r\nL 234.014316 87.988973 \r\n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n   </g>\r\n   <g id=\"line2d_28\">\r\n    <path clip-path=\"url(#pcbf9ee57b8)\" d=\"M 42.620312 73.997685 \r\nL 46.526313 73.997685 \r\nL 50.432313 73.997685 \r\nL 54.338313 73.997685 \r\nL 58.244313 73.997685 \r\nL 62.150312 73.997685 \r\nL 66.056313 73.997685 \r\nL 69.962312 73.997685 \r\nL 73.868313 73.997685 \r\nL 77.774314 73.997685 \r\nL 81.680312 73.997685 \r\nL 85.586313 73.997685 \r\nL 89.492314 73.997685 \r\nL 93.398311 73.997685 \r\nL 97.304312 73.997685 \r\nL 101.210313 73.997685 \r\nL 105.116313 73.997685 \r\nL 109.022314 73.997685 \r\nL 112.928315 73.997685 \r\nL 116.834312 73.997685 \r\nL 120.740313 73.997685 \r\nL 124.646309 73.997685 \r\nL 128.552314 73.997685 \r\nL 132.458311 73.997685 \r\nL 136.364316 73.997685 \r\nL 140.270312 73.997685 \r\nL 144.176318 73.997685 \r\nL 148.082314 73.997685 \r\nL 151.98832 73.997685 \r\nL 155.894316 73.997685 \r\nL 159.800313 73.997685 \r\nL 163.706318 73.997685 \r\nL 167.612314 73.997685 \r\nL 171.518311 73.997685 \r\nL 175.424316 73.997685 \r\nL 179.330312 73.997685 \r\nL 183.236318 73.997685 \r\nL 187.142314 73.997685 \r\nL 191.048311 73.997685 \r\nL 194.954316 73.997685 \r\nL 198.860313 73.997685 \r\nL 202.766309 73.997685 \r\nL 206.672305 73.997685 \r\nL 210.57832 73.997685 \r\nL 214.484316 73.997685 \r\nL 218.390312 73.997685 \r\nL 222.296309 73.997685 \r\nL 226.202305 73.997685 \r\nL 230.10832 73.997685 \r\nL 234.014316 73.997685 \r\n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\r\n   </g>\r\n   <g id=\"line2d_29\">\r\n    <defs>\r\n     <path d=\"M 0 3 \r\nC 0.795609 3 1.55874 2.683901 2.12132 2.12132 \r\nC 2.683901 1.55874 3 0.795609 3 0 \r\nC 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \r\nC 1.55874 -2.683901 0.795609 -3 0 -3 \r\nC -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \r\nC -2.683901 -1.55874 -3 -0.795609 -3 0 \r\nC -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \r\nC -1.55874 2.683901 -0.795609 3 0 3 \r\nz\r\n\" id=\"m7ba966af74\" style=\"stroke:#ff7f0e;stroke-opacity:0.5;\"/>\r\n    </defs>\r\n    <g clip-path=\"url(#pcbf9ee57b8)\">\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"45.039303\" xlink:href=\"#m7ba966af74\" y=\"111.971489\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"47.052496\" xlink:href=\"#m7ba966af74\" y=\"107.404747\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"48.700005\" xlink:href=\"#m7ba966af74\" y=\"103.464765\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"51.436416\" xlink:href=\"#m7ba966af74\" y=\"101.229984\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"51.785907\" xlink:href=\"#m7ba966af74\" y=\"97.763168\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"51.976025\" xlink:href=\"#m7ba966af74\" y=\"97.146049\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"59.354316\" xlink:href=\"#m7ba966af74\" y=\"94.452979\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"61.084335\" xlink:href=\"#m7ba966af74\" y=\"77.17831\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"63.164905\" xlink:href=\"#m7ba966af74\" y=\"80.396359\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"63.287471\" xlink:href=\"#m7ba966af74\" y=\"109.545358\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"64.707158\" xlink:href=\"#m7ba966af74\" y=\"84.941257\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"66.747369\" xlink:href=\"#m7ba966af74\" y=\"71.223774\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"70.741614\" xlink:href=\"#m7ba966af74\" y=\"55.309981\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"75.763089\" xlink:href=\"#m7ba966af74\" y=\"69.454059\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"89.26767\" xlink:href=\"#m7ba966af74\" y=\"66.389008\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"91.608912\" xlink:href=\"#m7ba966af74\" y=\"38.085262\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"98.543175\" xlink:href=\"#m7ba966af74\" y=\"67.204852\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"98.593911\" xlink:href=\"#m7ba966af74\" y=\"42.613805\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"104.056196\" xlink:href=\"#m7ba966af74\" y=\"54.983773\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"108.625447\" xlink:href=\"#m7ba966af74\" y=\"39.928754\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"109.45497\" xlink:href=\"#m7ba966af74\" y=\"47.600294\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"110.146237\" xlink:href=\"#m7ba966af74\" y=\"32.358306\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.028057\" xlink:href=\"#m7ba966af74\" y=\"38.583764\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"127.63259\" xlink:href=\"#m7ba966af74\" y=\"62.314745\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"130.443775\" xlink:href=\"#m7ba966af74\" y=\"34.809064\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"132.525017\" xlink:href=\"#m7ba966af74\" y=\"44.808552\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"136.956823\" xlink:href=\"#m7ba966af74\" y=\"38.226093\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"146.427311\" xlink:href=\"#m7ba966af74\" y=\"69.931338\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"148.155577\" xlink:href=\"#m7ba966af74\" y=\"68.895605\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"150.836757\" xlink:href=\"#m7ba966af74\" y=\"47.116778\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"152.121397\" xlink:href=\"#m7ba966af74\" y=\"69.856664\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"154.98315\" xlink:href=\"#m7ba966af74\" y=\"52.704254\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"157.72042\" xlink:href=\"#m7ba966af74\" y=\"76.517836\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"162.110422\" xlink:href=\"#m7ba966af74\" y=\"51.543469\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"166.311126\" xlink:href=\"#m7ba966af74\" y=\"63.6544\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"177.229216\" xlink:href=\"#m7ba966af74\" y=\"57.389688\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"184.263324\" xlink:href=\"#m7ba966af74\" y=\"60.912836\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"184.43002\" xlink:href=\"#m7ba966af74\" y=\"80.021282\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"199.469843\" xlink:href=\"#m7ba966af74\" y=\"106.839425\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"201.362299\" xlink:href=\"#m7ba966af74\" y=\"108.297862\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"208.598026\" xlink:href=\"#m7ba966af74\" y=\"90.090321\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"209.294574\" xlink:href=\"#m7ba966af74\" y=\"91.543634\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"209.317707\" xlink:href=\"#m7ba966af74\" y=\"90.190481\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"216.944285\" xlink:href=\"#m7ba966af74\" y=\"75.569732\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"220.264107\" xlink:href=\"#m7ba966af74\" y=\"95.765385\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"222.365427\" xlink:href=\"#m7ba966af74\" y=\"103.217595\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"225.05186\" xlink:href=\"#m7ba966af74\" y=\"89.35038\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"228.270249\" xlink:href=\"#m7ba966af74\" y=\"101.122113\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"236.306192\" xlink:href=\"#m7ba966af74\" y=\"77.025491\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"237.802973\" xlink:href=\"#m7ba966af74\" y=\"102.938964\"/>\r\n    </g>\r\n   </g>\r\n   <g id=\"patch_3\">\r\n    <path d=\"M 42.620312 146.899219 \r\nL 42.620312 10.999219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_4\">\r\n    <path d=\"M 237.920313 146.899219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_5\">\r\n    <path d=\"M 42.620312 146.899219 \r\nL 237.920313 146.899219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_6\">\r\n    <path d=\"M 42.620312 10.999219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"legend_1\">\r\n    <g id=\"patch_7\">\r\n     <path d=\"M 173.58125 48.355469 \r\nL 230.920313 48.355469 \r\nQ 232.920313 48.355469 232.920313 46.355469 \r\nL 232.920313 17.999219 \r\nQ 232.920313 15.999219 230.920313 15.999219 \r\nL 173.58125 15.999219 \r\nQ 171.58125 15.999219 171.58125 17.999219 \r\nL 171.58125 46.355469 \r\nQ 171.58125 48.355469 173.58125 48.355469 \r\nz\r\n\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\r\n    </g>\r\n    <g id=\"line2d_30\">\r\n     <path d=\"M 175.58125 24.097656 \r\nL 195.58125 24.097656 \r\n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n    </g>\r\n    <g id=\"line2d_31\"/>\r\n    <g id=\"text_16\">\r\n     <!-- Truth -->\r\n     <g transform=\"translate(203.58125 27.597656)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M -0.296875 72.90625 \r\nL 61.375 72.90625 \r\nL 61.375 64.59375 \r\nL 35.5 64.59375 \r\nL 35.5 0 \r\nL 25.59375 0 \r\nL 25.59375 64.59375 \r\nL -0.296875 64.59375 \r\nz\r\n\" id=\"DejaVuSans-84\"/>\r\n       <path d=\"M 41.109375 46.296875 \r\nQ 39.59375 47.171875 37.8125 47.578125 \r\nQ 36.03125 48 33.890625 48 \r\nQ 26.265625 48 22.1875 43.046875 \r\nQ 18.109375 38.09375 18.109375 28.8125 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 54.6875 \r\nL 18.109375 54.6875 \r\nL 18.109375 46.1875 \r\nQ 20.953125 51.171875 25.484375 53.578125 \r\nQ 30.03125 56 36.53125 56 \r\nQ 37.453125 56 38.578125 55.875 \r\nQ 39.703125 55.765625 41.0625 55.515625 \r\nz\r\n\" id=\"DejaVuSans-114\"/>\r\n       <path d=\"M 8.5 21.578125 \r\nL 8.5 54.6875 \r\nL 17.484375 54.6875 \r\nL 17.484375 21.921875 \r\nQ 17.484375 14.15625 20.5 10.265625 \r\nQ 23.53125 6.390625 29.59375 6.390625 \r\nQ 36.859375 6.390625 41.078125 11.03125 \r\nQ 45.3125 15.671875 45.3125 23.6875 \r\nL 45.3125 54.6875 \r\nL 54.296875 54.6875 \r\nL 54.296875 0 \r\nL 45.3125 0 \r\nL 45.3125 8.40625 \r\nQ 42.046875 3.421875 37.71875 1 \r\nQ 33.40625 -1.421875 27.6875 -1.421875 \r\nQ 18.265625 -1.421875 13.375 4.4375 \r\nQ 8.5 10.296875 8.5 21.578125 \r\nz\r\nM 31.109375 56 \r\nz\r\n\" id=\"DejaVuSans-117\"/>\r\n       <path d=\"M 18.3125 70.21875 \r\nL 18.3125 54.6875 \r\nL 36.8125 54.6875 \r\nL 36.8125 47.703125 \r\nL 18.3125 47.703125 \r\nL 18.3125 18.015625 \r\nQ 18.3125 11.328125 20.140625 9.421875 \r\nQ 21.96875 7.515625 27.59375 7.515625 \r\nL 36.8125 7.515625 \r\nL 36.8125 0 \r\nL 27.59375 0 \r\nQ 17.1875 0 13.234375 3.875 \r\nQ 9.28125 7.765625 9.28125 18.015625 \r\nL 9.28125 47.703125 \r\nL 2.6875 47.703125 \r\nL 2.6875 54.6875 \r\nL 9.28125 54.6875 \r\nL 9.28125 70.21875 \r\nz\r\n\" id=\"DejaVuSans-116\"/>\r\n       <path d=\"M 54.890625 33.015625 \r\nL 54.890625 0 \r\nL 45.90625 0 \r\nL 45.90625 32.71875 \r\nQ 45.90625 40.484375 42.875 44.328125 \r\nQ 39.84375 48.1875 33.796875 48.1875 \r\nQ 26.515625 48.1875 22.3125 43.546875 \r\nQ 18.109375 38.921875 18.109375 30.90625 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 75.984375 \r\nL 18.109375 75.984375 \r\nL 18.109375 46.1875 \r\nQ 21.34375 51.125 25.703125 53.5625 \r\nQ 30.078125 56 35.796875 56 \r\nQ 45.21875 56 50.046875 50.171875 \r\nQ 54.890625 44.34375 54.890625 33.015625 \r\nz\r\n\" id=\"DejaVuSans-104\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-84\"/>\r\n      <use x=\"46.333984\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"87.447266\" xlink:href=\"#DejaVuSans-117\"/>\r\n      <use x=\"150.826172\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"190.035156\" xlink:href=\"#DejaVuSans-104\"/>\r\n     </g>\r\n    </g>\r\n    <g id=\"line2d_32\">\r\n     <path d=\"M 175.58125 38.775781 \r\nL 195.58125 38.775781 \r\n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\r\n    </g>\r\n    <g id=\"line2d_33\"/>\r\n    <g id=\"text_17\">\r\n     <!-- Pred -->\r\n     <g transform=\"translate(203.58125 42.275781)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 19.671875 64.796875 \r\nL 19.671875 37.40625 \r\nL 32.078125 37.40625 \r\nQ 38.96875 37.40625 42.71875 40.96875 \r\nQ 46.484375 44.53125 46.484375 51.125 \r\nQ 46.484375 57.671875 42.71875 61.234375 \r\nQ 38.96875 64.796875 32.078125 64.796875 \r\nz\r\nM 9.8125 72.90625 \r\nL 32.078125 72.90625 \r\nQ 44.34375 72.90625 50.609375 67.359375 \r\nQ 56.890625 61.8125 56.890625 51.125 \r\nQ 56.890625 40.328125 50.609375 34.8125 \r\nQ 44.34375 29.296875 32.078125 29.296875 \r\nL 19.671875 29.296875 \r\nL 19.671875 0 \r\nL 9.8125 0 \r\nz\r\n\" id=\"DejaVuSans-80\"/>\r\n       <path d=\"M 56.203125 29.59375 \r\nL 56.203125 25.203125 \r\nL 14.890625 25.203125 \r\nQ 15.484375 15.921875 20.484375 11.0625 \r\nQ 25.484375 6.203125 34.421875 6.203125 \r\nQ 39.59375 6.203125 44.453125 7.46875 \r\nQ 49.3125 8.734375 54.109375 11.28125 \r\nL 54.109375 2.78125 \r\nQ 49.265625 0.734375 44.1875 -0.34375 \r\nQ 39.109375 -1.421875 33.890625 -1.421875 \r\nQ 20.796875 -1.421875 13.15625 6.1875 \r\nQ 5.515625 13.8125 5.515625 26.8125 \r\nQ 5.515625 40.234375 12.765625 48.109375 \r\nQ 20.015625 56 32.328125 56 \r\nQ 43.359375 56 49.78125 48.890625 \r\nQ 56.203125 41.796875 56.203125 29.59375 \r\nz\r\nM 47.21875 32.234375 \r\nQ 47.125 39.59375 43.09375 43.984375 \r\nQ 39.0625 48.390625 32.421875 48.390625 \r\nQ 24.90625 48.390625 20.390625 44.140625 \r\nQ 15.875 39.890625 15.1875 32.171875 \r\nz\r\n\" id=\"DejaVuSans-101\"/>\r\n       <path d=\"M 45.40625 46.390625 \r\nL 45.40625 75.984375 \r\nL 54.390625 75.984375 \r\nL 54.390625 0 \r\nL 45.40625 0 \r\nL 45.40625 8.203125 \r\nQ 42.578125 3.328125 38.25 0.953125 \r\nQ 33.9375 -1.421875 27.875 -1.421875 \r\nQ 17.96875 -1.421875 11.734375 6.484375 \r\nQ 5.515625 14.40625 5.515625 27.296875 \r\nQ 5.515625 40.1875 11.734375 48.09375 \r\nQ 17.96875 56 27.875 56 \r\nQ 33.9375 56 38.25 53.625 \r\nQ 42.578125 51.265625 45.40625 46.390625 \r\nz\r\nM 14.796875 27.296875 \r\nQ 14.796875 17.390625 18.875 11.75 \r\nQ 22.953125 6.109375 30.078125 6.109375 \r\nQ 37.203125 6.109375 41.296875 11.75 \r\nQ 45.40625 17.390625 45.40625 27.296875 \r\nQ 45.40625 37.203125 41.296875 42.84375 \r\nQ 37.203125 48.484375 30.078125 48.484375 \r\nQ 22.953125 48.484375 18.875 42.84375 \r\nQ 14.796875 37.203125 14.796875 27.296875 \r\nz\r\n\" id=\"DejaVuSans-100\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-80\"/>\r\n      <use x=\"58.552734\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"97.416016\" xlink:href=\"#DejaVuSans-101\"/>\r\n      <use x=\"158.939453\" xlink:href=\"#DejaVuSans-100\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n  </g>\r\n </g>\r\n <defs>\r\n  <clipPath id=\"pcbf9ee57b8\">\r\n   <rect height=\"135.9\" width=\"195.3\" x=\"42.620312\" y=\"10.999219\"/>\r\n  </clipPath>\r\n </defs>\r\n</svg>\r\n",
      "text/plain": [
       "<Figure size 252x180 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "y_hat=torch.repeat_interleave(y_train.mean(),n_test)\n",
    "plot_kernel_reg(y_hat)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 非参数注意力汇聚\n",
    "\n",
    "通用的注意力汇聚公式：\n",
    "\n",
    "${f(x) = \\sum_{i=1}^n \\alpha(x, x_i) y_i,}$\n",
    "\n",
    "其中\n",
    "\n",
    "* x是查询\n",
    "* ${x_i,y_i}$是键值对\n",
    "* 比较上述两个公式，注意力汇聚是yi的加权平均。\n",
    "* 将查询x和键xi之间的关系建模为注意力权重 ${\\alpha(x, x_i)}$\n",
    "* 如上公式所示，所有键值对上得注意力权重都是有效的概率分布：他们是非负数的，并且和为1\n",
    "\n",
    "为了更好地理解注意力汇聚，仅考虑一个高斯核  \n",
    "$ {K(u) = \\frac{1}{\\sqrt{2\\pi}} \\exp(-\\frac{u^2}{2}).} $ \n",
    "\n",
    "将高斯核代入，可以得到\n",
    "\n",
    "![img](..\\img\\attention_Gussion_kernel_into_attention.jpg)\n",
    "\n",
    "如果一个键xi越接近给定的查询x，那么分配给这个键对应的yi的注意力权重就会越大，也就说“获得了更多注意力”。\n",
    "\n",
    "值得注意的是，Nadaraya-Waston核回归是一个非参数模型。\n",
    "\n",
    "接下来，我们将基于这个非参数的注意力汇聚模型来绘制预测结果。结果是预测线是平滑的，并且比平均汇聚产生的线更加真实。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"184.455469pt\" version=\"1.1\" viewBox=\"0 0 248.301563 184.455469\" width=\"248.301563pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n   <cc:Work>\r\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n    <dc:date>2021-11-26T11:00:51.239458</dc:date>\r\n    <dc:format>image/svg+xml</dc:format>\r\n    <dc:creator>\r\n     <cc:Agent>\r\n      <dc:title>Matplotlib v3.3.4, https://matplotlib.org/</dc:title>\r\n     </cc:Agent>\r\n    </dc:creator>\r\n   </cc:Work>\r\n  </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n  <g id=\"patch_1\">\r\n   <path d=\"M 0 184.455469 \r\nL 248.301563 184.455469 \r\nL 248.301563 -0 \r\nL 0 -0 \r\nz\r\n\" style=\"fill:none;\"/>\r\n  </g>\r\n  <g id=\"axes_1\">\r\n   <g id=\"patch_2\">\r\n    <path d=\"M 42.620312 146.899219 \r\nL 237.920313 146.899219 \r\nL 237.920313 10.999219 \r\nL 42.620312 10.999219 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n   </g>\r\n   <g id=\"matplotlib.axis_1\">\r\n    <g id=\"xtick_1\">\r\n     <g id=\"line2d_1\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 42.620312 146.899219 \r\nL 42.620312 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_2\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL 0 3.5 \r\n\" id=\"m79aecb4624\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m79aecb4624\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_1\">\r\n      <!-- 0 -->\r\n      <g transform=\"translate(39.439062 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 31.78125 66.40625 \r\nQ 24.171875 66.40625 20.328125 58.90625 \r\nQ 16.5 51.421875 16.5 36.375 \r\nQ 16.5 21.390625 20.328125 13.890625 \r\nQ 24.171875 6.390625 31.78125 6.390625 \r\nQ 39.453125 6.390625 43.28125 13.890625 \r\nQ 47.125 21.390625 47.125 36.375 \r\nQ 47.125 51.421875 43.28125 58.90625 \r\nQ 39.453125 66.40625 31.78125 66.40625 \r\nz\r\nM 31.78125 74.21875 \r\nQ 44.046875 74.21875 50.515625 64.515625 \r\nQ 56.984375 54.828125 56.984375 36.375 \r\nQ 56.984375 17.96875 50.515625 8.265625 \r\nQ 44.046875 -1.421875 31.78125 -1.421875 \r\nQ 19.53125 -1.421875 13.0625 8.265625 \r\nQ 6.59375 17.96875 6.59375 36.375 \r\nQ 6.59375 54.828125 13.0625 64.515625 \r\nQ 19.53125 74.21875 31.78125 74.21875 \r\nz\r\n\" id=\"DejaVuSans-48\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_2\">\r\n     <g id=\"line2d_3\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 81.680312 146.899219 \r\nL 81.680312 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_4\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"81.680312\" xlink:href=\"#m79aecb4624\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_2\">\r\n      <!-- 1 -->\r\n      <g transform=\"translate(78.499062 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 12.40625 8.296875 \r\nL 28.515625 8.296875 \r\nL 28.515625 63.921875 \r\nL 10.984375 60.40625 \r\nL 10.984375 69.390625 \r\nL 28.421875 72.90625 \r\nL 38.28125 72.90625 \r\nL 38.28125 8.296875 \r\nL 54.390625 8.296875 \r\nL 54.390625 0 \r\nL 12.40625 0 \r\nz\r\n\" id=\"DejaVuSans-49\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_3\">\r\n     <g id=\"line2d_5\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 120.740313 146.899219 \r\nL 120.740313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_6\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"120.740313\" xlink:href=\"#m79aecb4624\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_3\">\r\n      <!-- 2 -->\r\n      <g transform=\"translate(117.559062 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 19.1875 8.296875 \r\nL 53.609375 8.296875 \r\nL 53.609375 0 \r\nL 7.328125 0 \r\nL 7.328125 8.296875 \r\nQ 12.9375 14.109375 22.625 23.890625 \r\nQ 32.328125 33.6875 34.8125 36.53125 \r\nQ 39.546875 41.84375 41.421875 45.53125 \r\nQ 43.3125 49.21875 43.3125 52.78125 \r\nQ 43.3125 58.59375 39.234375 62.25 \r\nQ 35.15625 65.921875 28.609375 65.921875 \r\nQ 23.96875 65.921875 18.8125 64.3125 \r\nQ 13.671875 62.703125 7.8125 59.421875 \r\nL 7.8125 69.390625 \r\nQ 13.765625 71.78125 18.9375 73 \r\nQ 24.125 74.21875 28.421875 74.21875 \r\nQ 39.75 74.21875 46.484375 68.546875 \r\nQ 53.21875 62.890625 53.21875 53.421875 \r\nQ 53.21875 48.921875 51.53125 44.890625 \r\nQ 49.859375 40.875 45.40625 35.40625 \r\nQ 44.1875 33.984375 37.640625 27.21875 \r\nQ 31.109375 20.453125 19.1875 8.296875 \r\nz\r\n\" id=\"DejaVuSans-50\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_4\">\r\n     <g id=\"line2d_7\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 159.800313 146.899219 \r\nL 159.800313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_8\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"159.800313\" xlink:href=\"#m79aecb4624\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_4\">\r\n      <!-- 3 -->\r\n      <g transform=\"translate(156.619063 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 40.578125 39.3125 \r\nQ 47.65625 37.796875 51.625 33 \r\nQ 55.609375 28.21875 55.609375 21.1875 \r\nQ 55.609375 10.40625 48.1875 4.484375 \r\nQ 40.765625 -1.421875 27.09375 -1.421875 \r\nQ 22.515625 -1.421875 17.65625 -0.515625 \r\nQ 12.796875 0.390625 7.625 2.203125 \r\nL 7.625 11.71875 \r\nQ 11.71875 9.328125 16.59375 8.109375 \r\nQ 21.484375 6.890625 26.8125 6.890625 \r\nQ 36.078125 6.890625 40.9375 10.546875 \r\nQ 45.796875 14.203125 45.796875 21.1875 \r\nQ 45.796875 27.640625 41.28125 31.265625 \r\nQ 36.765625 34.90625 28.71875 34.90625 \r\nL 20.21875 34.90625 \r\nL 20.21875 43.015625 \r\nL 29.109375 43.015625 \r\nQ 36.375 43.015625 40.234375 45.921875 \r\nQ 44.09375 48.828125 44.09375 54.296875 \r\nQ 44.09375 59.90625 40.109375 62.90625 \r\nQ 36.140625 65.921875 28.71875 65.921875 \r\nQ 24.65625 65.921875 20.015625 65.03125 \r\nQ 15.375 64.15625 9.8125 62.3125 \r\nL 9.8125 71.09375 \r\nQ 15.4375 72.65625 20.34375 73.4375 \r\nQ 25.25 74.21875 29.59375 74.21875 \r\nQ 40.828125 74.21875 47.359375 69.109375 \r\nQ 53.90625 64.015625 53.90625 55.328125 \r\nQ 53.90625 49.265625 50.4375 45.09375 \r\nQ 46.96875 40.921875 40.578125 39.3125 \r\nz\r\n\" id=\"DejaVuSans-51\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-51\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_5\">\r\n     <g id=\"line2d_9\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 198.860313 146.899219 \r\nL 198.860313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_10\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"198.860313\" xlink:href=\"#m79aecb4624\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_5\">\r\n      <!-- 4 -->\r\n      <g transform=\"translate(195.679063 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 37.796875 64.3125 \r\nL 12.890625 25.390625 \r\nL 37.796875 25.390625 \r\nz\r\nM 35.203125 72.90625 \r\nL 47.609375 72.90625 \r\nL 47.609375 25.390625 \r\nL 58.015625 25.390625 \r\nL 58.015625 17.1875 \r\nL 47.609375 17.1875 \r\nL 47.609375 0 \r\nL 37.796875 0 \r\nL 37.796875 17.1875 \r\nL 4.890625 17.1875 \r\nL 4.890625 26.703125 \r\nz\r\n\" id=\"DejaVuSans-52\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_6\">\r\n     <g id=\"line2d_11\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 237.920313 146.899219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_12\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"237.920313\" xlink:href=\"#m79aecb4624\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_6\">\r\n      <!-- 5 -->\r\n      <g transform=\"translate(234.739063 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 10.796875 72.90625 \r\nL 49.515625 72.90625 \r\nL 49.515625 64.59375 \r\nL 19.828125 64.59375 \r\nL 19.828125 46.734375 \r\nQ 21.96875 47.46875 24.109375 47.828125 \r\nQ 26.265625 48.1875 28.421875 48.1875 \r\nQ 40.625 48.1875 47.75 41.5 \r\nQ 54.890625 34.8125 54.890625 23.390625 \r\nQ 54.890625 11.625 47.5625 5.09375 \r\nQ 40.234375 -1.421875 26.90625 -1.421875 \r\nQ 22.3125 -1.421875 17.546875 -0.640625 \r\nQ 12.796875 0.140625 7.71875 1.703125 \r\nL 7.71875 11.625 \r\nQ 12.109375 9.234375 16.796875 8.0625 \r\nQ 21.484375 6.890625 26.703125 6.890625 \r\nQ 35.15625 6.890625 40.078125 11.328125 \r\nQ 45.015625 15.765625 45.015625 23.390625 \r\nQ 45.015625 31 40.078125 35.4375 \r\nQ 35.15625 39.890625 26.703125 39.890625 \r\nQ 22.75 39.890625 18.8125 39.015625 \r\nQ 14.890625 38.140625 10.796875 36.28125 \r\nz\r\n\" id=\"DejaVuSans-53\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_7\">\r\n     <!-- x -->\r\n     <g transform=\"translate(137.310937 175.175781)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 54.890625 54.6875 \r\nL 35.109375 28.078125 \r\nL 55.90625 0 \r\nL 45.3125 0 \r\nL 29.390625 21.484375 \r\nL 13.484375 0 \r\nL 2.875 0 \r\nL 24.125 28.609375 \r\nL 4.6875 54.6875 \r\nL 15.28125 54.6875 \r\nL 29.78125 35.203125 \r\nL 44.28125 54.6875 \r\nz\r\n\" id=\"DejaVuSans-120\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-120\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"matplotlib.axis_2\">\r\n    <g id=\"ytick_1\">\r\n     <g id=\"line2d_13\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 42.620312 146.899219 \r\nL 237.920313 146.899219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_14\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL -3.5 0 \r\n\" id=\"m682fb71554\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m682fb71554\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_8\">\r\n      <!-- −1 -->\r\n      <g transform=\"translate(20.878125 150.698437)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 10.59375 35.5 \r\nL 73.1875 35.5 \r\nL 73.1875 27.203125 \r\nL 10.59375 27.203125 \r\nz\r\n\" id=\"DejaVuSans-8722\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-49\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_2\">\r\n     <g id=\"line2d_15\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 42.620312 124.249219 \r\nL 237.920313 124.249219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_16\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m682fb71554\" y=\"124.249219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_9\">\r\n      <!-- 0 -->\r\n      <g transform=\"translate(29.257812 128.048437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_3\">\r\n     <g id=\"line2d_17\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 42.620312 101.599219 \r\nL 237.920313 101.599219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_18\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m682fb71554\" y=\"101.599219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_10\">\r\n      <!-- 1 -->\r\n      <g transform=\"translate(29.257812 105.398437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_4\">\r\n     <g id=\"line2d_19\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 42.620312 78.949219 \r\nL 237.920313 78.949219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_20\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m682fb71554\" y=\"78.949219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_11\">\r\n      <!-- 2 -->\r\n      <g transform=\"translate(29.257812 82.748437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_5\">\r\n     <g id=\"line2d_21\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 42.620312 56.299219 \r\nL 237.920313 56.299219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_22\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m682fb71554\" y=\"56.299219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_12\">\r\n      <!-- 3 -->\r\n      <g transform=\"translate(29.257812 60.098437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-51\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_6\">\r\n     <g id=\"line2d_23\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 42.620312 33.649219 \r\nL 237.920313 33.649219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_24\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m682fb71554\" y=\"33.649219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_13\">\r\n      <!-- 4 -->\r\n      <g transform=\"translate(29.257812 37.448437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_7\">\r\n     <g id=\"line2d_25\">\r\n      <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 42.620312 10.999219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_26\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m682fb71554\" y=\"10.999219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_14\">\r\n      <!-- 5 -->\r\n      <g transform=\"translate(29.257812 14.798437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_15\">\r\n     <!-- y -->\r\n     <g transform=\"translate(14.798437 81.908594)rotate(-90)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 32.171875 -5.078125 \r\nQ 28.375 -14.84375 24.75 -17.8125 \r\nQ 21.140625 -20.796875 15.09375 -20.796875 \r\nL 7.90625 -20.796875 \r\nL 7.90625 -13.28125 \r\nL 13.1875 -13.28125 \r\nQ 16.890625 -13.28125 18.9375 -11.515625 \r\nQ 21 -9.765625 23.484375 -3.21875 \r\nL 25.09375 0.875 \r\nL 2.984375 54.6875 \r\nL 12.5 54.6875 \r\nL 29.59375 11.921875 \r\nL 46.6875 54.6875 \r\nL 56.203125 54.6875 \r\nz\r\n\" id=\"DejaVuSans-121\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-121\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"line2d_27\">\r\n    <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 42.620312 124.249219 \r\nL 46.526313 116.136982 \r\nL 50.432313 108.999323 \r\nL 54.338313 102.217148 \r\nL 58.244313 95.726379 \r\nL 62.150312 89.522233 \r\nL 66.056313 83.619087 \r\nL 69.962312 78.038824 \r\nL 73.868313 72.806 \r\nL 77.774314 67.945395 \r\nL 81.680312 63.480584 \r\nL 85.586313 59.432954 \r\nL 89.492314 55.821098 \r\nL 93.398311 52.660258 \r\nL 97.304312 49.962036 \r\nL 101.210313 47.734078 \r\nL 105.116313 45.979911 \r\nL 109.022314 44.69881 \r\nL 112.928315 43.885737 \r\nL 116.834312 43.531371 \r\nL 120.740313 43.622105 \r\nL 124.646309 44.140188 \r\nL 128.552314 45.063873 \r\nL 132.458311 46.367563 \r\nL 136.364316 48.022135 \r\nL 140.270312 49.995107 \r\nL 144.176318 52.251038 \r\nL 148.082314 54.751808 \r\nL 151.98832 57.457039 \r\nL 155.894316 60.324422 \r\nL 159.800313 63.310193 \r\nL 163.706318 66.369546 \r\nL 167.612314 69.45704 \r\nL 171.518311 72.527086 \r\nL 175.424316 75.534393 \r\nL 179.330312 78.434371 \r\nL 183.236318 81.183652 \r\nL 187.142314 83.740416 \r\nL 191.048311 86.06491 \r\nL 194.954316 88.119776 \r\nL 198.860313 89.870412 \r\nL 202.766309 91.285368 \r\nL 206.672305 92.336626 \r\nL 210.57832 92.999866 \r\nL 214.484316 93.254719 \r\nL 218.390312 93.084986 \r\nL 222.296309 92.478756 \r\nL 226.202305 91.428572 \r\nL 230.10832 89.931453 \r\nL 234.014316 87.988973 \r\n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n   </g>\r\n   <g id=\"line2d_28\">\r\n    <path clip-path=\"url(#pbaa9a69d50)\" d=\"M 42.620312 82.870447 \r\nL 46.526313 81.75991 \r\nL 50.432313 80.592769 \r\nL 54.338313 79.370382 \r\nL 58.244313 78.095429 \r\nL 62.150312 76.772114 \r\nL 66.056313 75.40643 \r\nL 69.962312 74.006347 \r\nL 73.868313 72.581849 \r\nL 77.774314 71.145115 \r\nL 81.680312 69.710422 \r\nL 85.586313 68.294003 \r\nL 89.492314 66.913733 \r\nL 93.398311 65.588739 \r\nL 97.304312 64.338857 \r\nL 101.210313 63.183996 \r\nL 105.116313 62.143446 \r\nL 109.022314 61.235195 \r\nL 112.928315 60.47526 \r\nL 116.834312 59.877184 \r\nL 120.740313 59.451618 \r\nL 124.646309 59.206023 \r\nL 128.552314 59.144612 \r\nL 132.458311 59.268357 \r\nL 136.364316 59.575141 \r\nL 140.270312 60.059937 \r\nL 144.176318 60.715082 \r\nL 148.082314 61.53046 \r\nL 151.98832 62.493782 \r\nL 155.894316 63.590759 \r\nL 159.800313 64.805389 \r\nL 163.706318 66.120117 \r\nL 167.612314 67.516194 \r\nL 171.518311 68.974016 \r\nL 175.424316 70.473527 \r\nL 179.330312 71.994704 \r\nL 183.236318 73.518138 \r\nL 187.142314 75.025491 \r\nL 191.048311 76.500032 \r\nL 194.954316 77.927073 \r\nL 198.860313 79.294199 \r\nL 202.766309 80.591533 \r\nL 206.672305 81.811706 \r\nL 210.57832 82.949851 \r\nL 214.484316 84.003342 \r\nL 218.390312 84.971633 \r\nL 222.296309 85.855829 \r\nL 226.202305 86.658468 \r\nL 230.10832 87.383151 \r\nL 234.014316 88.034253 \r\n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\r\n   </g>\r\n   <g id=\"line2d_29\">\r\n    <defs>\r\n     <path d=\"M 0 3 \r\nC 0.795609 3 1.55874 2.683901 2.12132 2.12132 \r\nC 2.683901 1.55874 3 0.795609 3 0 \r\nC 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \r\nC 1.55874 -2.683901 0.795609 -3 0 -3 \r\nC -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \r\nC -2.683901 -1.55874 -3 -0.795609 -3 0 \r\nC -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \r\nC -1.55874 2.683901 -0.795609 3 0 3 \r\nz\r\n\" id=\"m264f0bc3b8\" style=\"stroke:#ff7f0e;stroke-opacity:0.5;\"/>\r\n    </defs>\r\n    <g clip-path=\"url(#pbaa9a69d50)\">\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"45.039303\" xlink:href=\"#m264f0bc3b8\" y=\"111.971489\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"47.052496\" xlink:href=\"#m264f0bc3b8\" y=\"107.404747\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"48.700005\" xlink:href=\"#m264f0bc3b8\" y=\"103.464765\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"51.436416\" xlink:href=\"#m264f0bc3b8\" y=\"101.229984\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"51.785907\" xlink:href=\"#m264f0bc3b8\" y=\"97.763168\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"51.976025\" xlink:href=\"#m264f0bc3b8\" y=\"97.146049\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"59.354316\" xlink:href=\"#m264f0bc3b8\" y=\"94.452979\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"61.084335\" xlink:href=\"#m264f0bc3b8\" y=\"77.17831\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"63.164905\" xlink:href=\"#m264f0bc3b8\" y=\"80.396359\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"63.287471\" xlink:href=\"#m264f0bc3b8\" y=\"109.545358\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"64.707158\" xlink:href=\"#m264f0bc3b8\" y=\"84.941257\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"66.747369\" xlink:href=\"#m264f0bc3b8\" y=\"71.223774\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"70.741614\" xlink:href=\"#m264f0bc3b8\" y=\"55.309981\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"75.763089\" xlink:href=\"#m264f0bc3b8\" y=\"69.454059\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"89.26767\" xlink:href=\"#m264f0bc3b8\" y=\"66.389008\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"91.608912\" xlink:href=\"#m264f0bc3b8\" y=\"38.085262\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"98.543175\" xlink:href=\"#m264f0bc3b8\" y=\"67.204852\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"98.593911\" xlink:href=\"#m264f0bc3b8\" y=\"42.613805\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"104.056196\" xlink:href=\"#m264f0bc3b8\" y=\"54.983773\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"108.625447\" xlink:href=\"#m264f0bc3b8\" y=\"39.928754\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"109.45497\" xlink:href=\"#m264f0bc3b8\" y=\"47.600294\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"110.146237\" xlink:href=\"#m264f0bc3b8\" y=\"32.358306\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.028057\" xlink:href=\"#m264f0bc3b8\" y=\"38.583764\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"127.63259\" xlink:href=\"#m264f0bc3b8\" y=\"62.314745\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"130.443775\" xlink:href=\"#m264f0bc3b8\" y=\"34.809064\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"132.525017\" xlink:href=\"#m264f0bc3b8\" y=\"44.808552\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"136.956823\" xlink:href=\"#m264f0bc3b8\" y=\"38.226093\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"146.427311\" xlink:href=\"#m264f0bc3b8\" y=\"69.931338\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"148.155577\" xlink:href=\"#m264f0bc3b8\" y=\"68.895605\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"150.836757\" xlink:href=\"#m264f0bc3b8\" y=\"47.116778\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"152.121397\" xlink:href=\"#m264f0bc3b8\" y=\"69.856664\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"154.98315\" xlink:href=\"#m264f0bc3b8\" y=\"52.704254\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"157.72042\" xlink:href=\"#m264f0bc3b8\" y=\"76.517836\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"162.110422\" xlink:href=\"#m264f0bc3b8\" y=\"51.543469\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"166.311126\" xlink:href=\"#m264f0bc3b8\" y=\"63.6544\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"177.229216\" xlink:href=\"#m264f0bc3b8\" y=\"57.389688\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"184.263324\" xlink:href=\"#m264f0bc3b8\" y=\"60.912836\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"184.43002\" xlink:href=\"#m264f0bc3b8\" y=\"80.021282\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"199.469843\" xlink:href=\"#m264f0bc3b8\" y=\"106.839425\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"201.362299\" xlink:href=\"#m264f0bc3b8\" y=\"108.297862\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"208.598026\" xlink:href=\"#m264f0bc3b8\" y=\"90.090321\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"209.294574\" xlink:href=\"#m264f0bc3b8\" y=\"91.543634\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"209.317707\" xlink:href=\"#m264f0bc3b8\" y=\"90.190481\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"216.944285\" xlink:href=\"#m264f0bc3b8\" y=\"75.569732\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"220.264107\" xlink:href=\"#m264f0bc3b8\" y=\"95.765385\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"222.365427\" xlink:href=\"#m264f0bc3b8\" y=\"103.217595\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"225.05186\" xlink:href=\"#m264f0bc3b8\" y=\"89.35038\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"228.270249\" xlink:href=\"#m264f0bc3b8\" y=\"101.122113\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"236.306192\" xlink:href=\"#m264f0bc3b8\" y=\"77.025491\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"237.802973\" xlink:href=\"#m264f0bc3b8\" y=\"102.938964\"/>\r\n    </g>\r\n   </g>\r\n   <g id=\"patch_3\">\r\n    <path d=\"M 42.620312 146.899219 \r\nL 42.620312 10.999219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_4\">\r\n    <path d=\"M 237.920313 146.899219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_5\">\r\n    <path d=\"M 42.620312 146.899219 \r\nL 237.920313 146.899219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_6\">\r\n    <path d=\"M 42.620312 10.999219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"legend_1\">\r\n    <g id=\"patch_7\">\r\n     <path d=\"M 173.58125 48.355469 \r\nL 230.920313 48.355469 \r\nQ 232.920313 48.355469 232.920313 46.355469 \r\nL 232.920313 17.999219 \r\nQ 232.920313 15.999219 230.920313 15.999219 \r\nL 173.58125 15.999219 \r\nQ 171.58125 15.999219 171.58125 17.999219 \r\nL 171.58125 46.355469 \r\nQ 171.58125 48.355469 173.58125 48.355469 \r\nz\r\n\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\r\n    </g>\r\n    <g id=\"line2d_30\">\r\n     <path d=\"M 175.58125 24.097656 \r\nL 195.58125 24.097656 \r\n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n    </g>\r\n    <g id=\"line2d_31\"/>\r\n    <g id=\"text_16\">\r\n     <!-- Truth -->\r\n     <g transform=\"translate(203.58125 27.597656)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M -0.296875 72.90625 \r\nL 61.375 72.90625 \r\nL 61.375 64.59375 \r\nL 35.5 64.59375 \r\nL 35.5 0 \r\nL 25.59375 0 \r\nL 25.59375 64.59375 \r\nL -0.296875 64.59375 \r\nz\r\n\" id=\"DejaVuSans-84\"/>\r\n       <path d=\"M 41.109375 46.296875 \r\nQ 39.59375 47.171875 37.8125 47.578125 \r\nQ 36.03125 48 33.890625 48 \r\nQ 26.265625 48 22.1875 43.046875 \r\nQ 18.109375 38.09375 18.109375 28.8125 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 54.6875 \r\nL 18.109375 54.6875 \r\nL 18.109375 46.1875 \r\nQ 20.953125 51.171875 25.484375 53.578125 \r\nQ 30.03125 56 36.53125 56 \r\nQ 37.453125 56 38.578125 55.875 \r\nQ 39.703125 55.765625 41.0625 55.515625 \r\nz\r\n\" id=\"DejaVuSans-114\"/>\r\n       <path d=\"M 8.5 21.578125 \r\nL 8.5 54.6875 \r\nL 17.484375 54.6875 \r\nL 17.484375 21.921875 \r\nQ 17.484375 14.15625 20.5 10.265625 \r\nQ 23.53125 6.390625 29.59375 6.390625 \r\nQ 36.859375 6.390625 41.078125 11.03125 \r\nQ 45.3125 15.671875 45.3125 23.6875 \r\nL 45.3125 54.6875 \r\nL 54.296875 54.6875 \r\nL 54.296875 0 \r\nL 45.3125 0 \r\nL 45.3125 8.40625 \r\nQ 42.046875 3.421875 37.71875 1 \r\nQ 33.40625 -1.421875 27.6875 -1.421875 \r\nQ 18.265625 -1.421875 13.375 4.4375 \r\nQ 8.5 10.296875 8.5 21.578125 \r\nz\r\nM 31.109375 56 \r\nz\r\n\" id=\"DejaVuSans-117\"/>\r\n       <path d=\"M 18.3125 70.21875 \r\nL 18.3125 54.6875 \r\nL 36.8125 54.6875 \r\nL 36.8125 47.703125 \r\nL 18.3125 47.703125 \r\nL 18.3125 18.015625 \r\nQ 18.3125 11.328125 20.140625 9.421875 \r\nQ 21.96875 7.515625 27.59375 7.515625 \r\nL 36.8125 7.515625 \r\nL 36.8125 0 \r\nL 27.59375 0 \r\nQ 17.1875 0 13.234375 3.875 \r\nQ 9.28125 7.765625 9.28125 18.015625 \r\nL 9.28125 47.703125 \r\nL 2.6875 47.703125 \r\nL 2.6875 54.6875 \r\nL 9.28125 54.6875 \r\nL 9.28125 70.21875 \r\nz\r\n\" id=\"DejaVuSans-116\"/>\r\n       <path d=\"M 54.890625 33.015625 \r\nL 54.890625 0 \r\nL 45.90625 0 \r\nL 45.90625 32.71875 \r\nQ 45.90625 40.484375 42.875 44.328125 \r\nQ 39.84375 48.1875 33.796875 48.1875 \r\nQ 26.515625 48.1875 22.3125 43.546875 \r\nQ 18.109375 38.921875 18.109375 30.90625 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 75.984375 \r\nL 18.109375 75.984375 \r\nL 18.109375 46.1875 \r\nQ 21.34375 51.125 25.703125 53.5625 \r\nQ 30.078125 56 35.796875 56 \r\nQ 45.21875 56 50.046875 50.171875 \r\nQ 54.890625 44.34375 54.890625 33.015625 \r\nz\r\n\" id=\"DejaVuSans-104\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-84\"/>\r\n      <use x=\"46.333984\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"87.447266\" xlink:href=\"#DejaVuSans-117\"/>\r\n      <use x=\"150.826172\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"190.035156\" xlink:href=\"#DejaVuSans-104\"/>\r\n     </g>\r\n    </g>\r\n    <g id=\"line2d_32\">\r\n     <path d=\"M 175.58125 38.775781 \r\nL 195.58125 38.775781 \r\n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\r\n    </g>\r\n    <g id=\"line2d_33\"/>\r\n    <g id=\"text_17\">\r\n     <!-- Pred -->\r\n     <g transform=\"translate(203.58125 42.275781)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 19.671875 64.796875 \r\nL 19.671875 37.40625 \r\nL 32.078125 37.40625 \r\nQ 38.96875 37.40625 42.71875 40.96875 \r\nQ 46.484375 44.53125 46.484375 51.125 \r\nQ 46.484375 57.671875 42.71875 61.234375 \r\nQ 38.96875 64.796875 32.078125 64.796875 \r\nz\r\nM 9.8125 72.90625 \r\nL 32.078125 72.90625 \r\nQ 44.34375 72.90625 50.609375 67.359375 \r\nQ 56.890625 61.8125 56.890625 51.125 \r\nQ 56.890625 40.328125 50.609375 34.8125 \r\nQ 44.34375 29.296875 32.078125 29.296875 \r\nL 19.671875 29.296875 \r\nL 19.671875 0 \r\nL 9.8125 0 \r\nz\r\n\" id=\"DejaVuSans-80\"/>\r\n       <path d=\"M 56.203125 29.59375 \r\nL 56.203125 25.203125 \r\nL 14.890625 25.203125 \r\nQ 15.484375 15.921875 20.484375 11.0625 \r\nQ 25.484375 6.203125 34.421875 6.203125 \r\nQ 39.59375 6.203125 44.453125 7.46875 \r\nQ 49.3125 8.734375 54.109375 11.28125 \r\nL 54.109375 2.78125 \r\nQ 49.265625 0.734375 44.1875 -0.34375 \r\nQ 39.109375 -1.421875 33.890625 -1.421875 \r\nQ 20.796875 -1.421875 13.15625 6.1875 \r\nQ 5.515625 13.8125 5.515625 26.8125 \r\nQ 5.515625 40.234375 12.765625 48.109375 \r\nQ 20.015625 56 32.328125 56 \r\nQ 43.359375 56 49.78125 48.890625 \r\nQ 56.203125 41.796875 56.203125 29.59375 \r\nz\r\nM 47.21875 32.234375 \r\nQ 47.125 39.59375 43.09375 43.984375 \r\nQ 39.0625 48.390625 32.421875 48.390625 \r\nQ 24.90625 48.390625 20.390625 44.140625 \r\nQ 15.875 39.890625 15.1875 32.171875 \r\nz\r\n\" id=\"DejaVuSans-101\"/>\r\n       <path d=\"M 45.40625 46.390625 \r\nL 45.40625 75.984375 \r\nL 54.390625 75.984375 \r\nL 54.390625 0 \r\nL 45.40625 0 \r\nL 45.40625 8.203125 \r\nQ 42.578125 3.328125 38.25 0.953125 \r\nQ 33.9375 -1.421875 27.875 -1.421875 \r\nQ 17.96875 -1.421875 11.734375 6.484375 \r\nQ 5.515625 14.40625 5.515625 27.296875 \r\nQ 5.515625 40.1875 11.734375 48.09375 \r\nQ 17.96875 56 27.875 56 \r\nQ 33.9375 56 38.25 53.625 \r\nQ 42.578125 51.265625 45.40625 46.390625 \r\nz\r\nM 14.796875 27.296875 \r\nQ 14.796875 17.390625 18.875 11.75 \r\nQ 22.953125 6.109375 30.078125 6.109375 \r\nQ 37.203125 6.109375 41.296875 11.75 \r\nQ 45.40625 17.390625 45.40625 27.296875 \r\nQ 45.40625 37.203125 41.296875 42.84375 \r\nQ 37.203125 48.484375 30.078125 48.484375 \r\nQ 22.953125 48.484375 18.875 42.84375 \r\nQ 14.796875 37.203125 14.796875 27.296875 \r\nz\r\n\" id=\"DejaVuSans-100\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-80\"/>\r\n      <use x=\"58.552734\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"97.416016\" xlink:href=\"#DejaVuSans-101\"/>\r\n      <use x=\"158.939453\" xlink:href=\"#DejaVuSans-100\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n  </g>\r\n </g>\r\n <defs>\r\n  <clipPath id=\"pbaa9a69d50\">\r\n   <rect height=\"135.9\" width=\"195.3\" x=\"42.620312\" y=\"10.999219\"/>\r\n  </clipPath>\r\n </defs>\r\n</svg>\r\n",
      "text/plain": [
       "<Figure size 252x180 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# `X_repeat` 的形状: (`n_test`, `n_train`),\n",
    "# 每一行都包含着相同的测试输入（例如：同样的查询）\n",
    "X_repeat = x_test.repeat_interleave(n_train).reshape((-1, n_train))\n",
    "# `x_train` 包含着键。`attention_weights` 的形状：(`n_test`, `n_train`),\n",
    "# 每一行都包含着要在给定的每个查询的值（`y_train`）之间分配的注意力权重\n",
    "attention_weights = nn.functional.softmax(-(X_repeat - x_train)**2 / 2, dim=1)\n",
    "# `y_hat` 的每个元素都是值的加权平均值，其中的权重是注意力权重\n",
    "y_hat = torch.matmul(attention_weights, y_train)\n",
    "plot_kernel_reg(y_hat)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.Size([50, 50])\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"159.039469pt\" version=\"1.1\" viewBox=\"0 0 199.72075 159.039469\" width=\"199.72075pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n   <cc:Work>\r\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n    <dc:date>2021-11-26T11:27:25.570702</dc:date>\r\n    <dc:format>image/svg+xml</dc:format>\r\n    <dc:creator>\r\n     <cc:Agent>\r\n      <dc:title>Matplotlib v3.3.4, https://matplotlib.org/</dc:title>\r\n     </cc:Agent>\r\n    </dc:creator>\r\n   </cc:Work>\r\n  </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n  <g id=\"patch_1\">\r\n   <path d=\"M 0 159.039469 \r\nL 199.72075 159.039469 \r\nL 199.72075 0 \r\nL 0 0 \r\nz\r\n\" style=\"fill:none;\"/>\r\n  </g>\r\n  <g id=\"axes_1\">\r\n   <g id=\"patch_2\">\r\n    <path d=\"M 40.603125 121.483219 \r\nL 152.203125 121.483219 \r\nL 152.203125 9.883219 \r\nL 40.603125 9.883219 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n   </g>\r\n   <g clip-path=\"url(#pebab890651)\">\r\n    <image height=\"112\" id=\"image147b150a58\" transform=\"scale(1 -1)translate(0 -112)\" width=\"112\" x=\"40.603125\" xlink:href=\"data:image/png;base64,\r\n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\" y=\"-9.483219\"/>\r\n   </g>\r\n   <g id=\"matplotlib.axis_1\">\r\n    <g id=\"xtick_1\">\r\n     <g id=\"line2d_1\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL 0 3.5 \r\n\" id=\"m24c673fd35\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"41.719125\" xlink:href=\"#m24c673fd35\" y=\"121.483219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_1\">\r\n      <!-- 0 -->\r\n      <g transform=\"translate(38.537875 136.081656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 31.78125 66.40625 \r\nQ 24.171875 66.40625 20.328125 58.90625 \r\nQ 16.5 51.421875 16.5 36.375 \r\nQ 16.5 21.390625 20.328125 13.890625 \r\nQ 24.171875 6.390625 31.78125 6.390625 \r\nQ 39.453125 6.390625 43.28125 13.890625 \r\nQ 47.125 21.390625 47.125 36.375 \r\nQ 47.125 51.421875 43.28125 58.90625 \r\nQ 39.453125 66.40625 31.78125 66.40625 \r\nz\r\nM 31.78125 74.21875 \r\nQ 44.046875 74.21875 50.515625 64.515625 \r\nQ 56.984375 54.828125 56.984375 36.375 \r\nQ 56.984375 17.96875 50.515625 8.265625 \r\nQ 44.046875 -1.421875 31.78125 -1.421875 \r\nQ 19.53125 -1.421875 13.0625 8.265625 \r\nQ 6.59375 17.96875 6.59375 36.375 \r\nQ 6.59375 54.828125 13.0625 64.515625 \r\nQ 19.53125 74.21875 31.78125 74.21875 \r\nz\r\n\" id=\"DejaVuSans-48\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_2\">\r\n     <g id=\"line2d_2\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"86.359125\" xlink:href=\"#m24c673fd35\" y=\"121.483219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_2\">\r\n      <!-- 20 -->\r\n      <g transform=\"translate(79.996625 136.081656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 19.1875 8.296875 \r\nL 53.609375 8.296875 \r\nL 53.609375 0 \r\nL 7.328125 0 \r\nL 7.328125 8.296875 \r\nQ 12.9375 14.109375 22.625 23.890625 \r\nQ 32.328125 33.6875 34.8125 36.53125 \r\nQ 39.546875 41.84375 41.421875 45.53125 \r\nQ 43.3125 49.21875 43.3125 52.78125 \r\nQ 43.3125 58.59375 39.234375 62.25 \r\nQ 35.15625 65.921875 28.609375 65.921875 \r\nQ 23.96875 65.921875 18.8125 64.3125 \r\nQ 13.671875 62.703125 7.8125 59.421875 \r\nL 7.8125 69.390625 \r\nQ 13.765625 71.78125 18.9375 73 \r\nQ 24.125 74.21875 28.421875 74.21875 \r\nQ 39.75 74.21875 46.484375 68.546875 \r\nQ 53.21875 62.890625 53.21875 53.421875 \r\nQ 53.21875 48.921875 51.53125 44.890625 \r\nQ 49.859375 40.875 45.40625 35.40625 \r\nQ 44.1875 33.984375 37.640625 27.21875 \r\nQ 31.109375 20.453125 19.1875 8.296875 \r\nz\r\n\" id=\"DejaVuSans-50\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_3\">\r\n     <g id=\"line2d_3\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"130.999125\" xlink:href=\"#m24c673fd35\" y=\"121.483219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_3\">\r\n      <!-- 40 -->\r\n      <g transform=\"translate(124.636625 136.081656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 37.796875 64.3125 \r\nL 12.890625 25.390625 \r\nL 37.796875 25.390625 \r\nz\r\nM 35.203125 72.90625 \r\nL 47.609375 72.90625 \r\nL 47.609375 25.390625 \r\nL 58.015625 25.390625 \r\nL 58.015625 17.1875 \r\nL 47.609375 17.1875 \r\nL 47.609375 0 \r\nL 37.796875 0 \r\nL 37.796875 17.1875 \r\nL 4.890625 17.1875 \r\nL 4.890625 26.703125 \r\nz\r\n\" id=\"DejaVuSans-52\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_4\">\r\n     <!-- Sorted training inputs -->\r\n     <g transform=\"translate(41.889844 149.759781)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 53.515625 70.515625 \r\nL 53.515625 60.890625 \r\nQ 47.90625 63.578125 42.921875 64.890625 \r\nQ 37.9375 66.21875 33.296875 66.21875 \r\nQ 25.25 66.21875 20.875 63.09375 \r\nQ 16.5 59.96875 16.5 54.203125 \r\nQ 16.5 49.359375 19.40625 46.890625 \r\nQ 22.3125 44.4375 30.421875 42.921875 \r\nL 36.375 41.703125 \r\nQ 47.40625 39.59375 52.65625 34.296875 \r\nQ 57.90625 29 57.90625 20.125 \r\nQ 57.90625 9.515625 50.796875 4.046875 \r\nQ 43.703125 -1.421875 29.984375 -1.421875 \r\nQ 24.8125 -1.421875 18.96875 -0.25 \r\nQ 13.140625 0.921875 6.890625 3.21875 \r\nL 6.890625 13.375 \r\nQ 12.890625 10.015625 18.65625 8.296875 \r\nQ 24.421875 6.59375 29.984375 6.59375 \r\nQ 38.421875 6.59375 43.015625 9.90625 \r\nQ 47.609375 13.234375 47.609375 19.390625 \r\nQ 47.609375 24.75 44.3125 27.78125 \r\nQ 41.015625 30.8125 33.5 32.328125 \r\nL 27.484375 33.5 \r\nQ 16.453125 35.6875 11.515625 40.375 \r\nQ 6.59375 45.0625 6.59375 53.421875 \r\nQ 6.59375 63.09375 13.40625 68.65625 \r\nQ 20.21875 74.21875 32.171875 74.21875 \r\nQ 37.3125 74.21875 42.625 73.28125 \r\nQ 47.953125 72.359375 53.515625 70.515625 \r\nz\r\n\" id=\"DejaVuSans-83\"/>\r\n       <path d=\"M 30.609375 48.390625 \r\nQ 23.390625 48.390625 19.1875 42.75 \r\nQ 14.984375 37.109375 14.984375 27.296875 \r\nQ 14.984375 17.484375 19.15625 11.84375 \r\nQ 23.34375 6.203125 30.609375 6.203125 \r\nQ 37.796875 6.203125 41.984375 11.859375 \r\nQ 46.1875 17.53125 46.1875 27.296875 \r\nQ 46.1875 37.015625 41.984375 42.703125 \r\nQ 37.796875 48.390625 30.609375 48.390625 \r\nz\r\nM 30.609375 56 \r\nQ 42.328125 56 49.015625 48.375 \r\nQ 55.71875 40.765625 55.71875 27.296875 \r\nQ 55.71875 13.875 49.015625 6.21875 \r\nQ 42.328125 -1.421875 30.609375 -1.421875 \r\nQ 18.84375 -1.421875 12.171875 6.21875 \r\nQ 5.515625 13.875 5.515625 27.296875 \r\nQ 5.515625 40.765625 12.171875 48.375 \r\nQ 18.84375 56 30.609375 56 \r\nz\r\n\" id=\"DejaVuSans-111\"/>\r\n       <path d=\"M 41.109375 46.296875 \r\nQ 39.59375 47.171875 37.8125 47.578125 \r\nQ 36.03125 48 33.890625 48 \r\nQ 26.265625 48 22.1875 43.046875 \r\nQ 18.109375 38.09375 18.109375 28.8125 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 54.6875 \r\nL 18.109375 54.6875 \r\nL 18.109375 46.1875 \r\nQ 20.953125 51.171875 25.484375 53.578125 \r\nQ 30.03125 56 36.53125 56 \r\nQ 37.453125 56 38.578125 55.875 \r\nQ 39.703125 55.765625 41.0625 55.515625 \r\nz\r\n\" id=\"DejaVuSans-114\"/>\r\n       <path d=\"M 18.3125 70.21875 \r\nL 18.3125 54.6875 \r\nL 36.8125 54.6875 \r\nL 36.8125 47.703125 \r\nL 18.3125 47.703125 \r\nL 18.3125 18.015625 \r\nQ 18.3125 11.328125 20.140625 9.421875 \r\nQ 21.96875 7.515625 27.59375 7.515625 \r\nL 36.8125 7.515625 \r\nL 36.8125 0 \r\nL 27.59375 0 \r\nQ 17.1875 0 13.234375 3.875 \r\nQ 9.28125 7.765625 9.28125 18.015625 \r\nL 9.28125 47.703125 \r\nL 2.6875 47.703125 \r\nL 2.6875 54.6875 \r\nL 9.28125 54.6875 \r\nL 9.28125 70.21875 \r\nz\r\n\" id=\"DejaVuSans-116\"/>\r\n       <path d=\"M 56.203125 29.59375 \r\nL 56.203125 25.203125 \r\nL 14.890625 25.203125 \r\nQ 15.484375 15.921875 20.484375 11.0625 \r\nQ 25.484375 6.203125 34.421875 6.203125 \r\nQ 39.59375 6.203125 44.453125 7.46875 \r\nQ 49.3125 8.734375 54.109375 11.28125 \r\nL 54.109375 2.78125 \r\nQ 49.265625 0.734375 44.1875 -0.34375 \r\nQ 39.109375 -1.421875 33.890625 -1.421875 \r\nQ 20.796875 -1.421875 13.15625 6.1875 \r\nQ 5.515625 13.8125 5.515625 26.8125 \r\nQ 5.515625 40.234375 12.765625 48.109375 \r\nQ 20.015625 56 32.328125 56 \r\nQ 43.359375 56 49.78125 48.890625 \r\nQ 56.203125 41.796875 56.203125 29.59375 \r\nz\r\nM 47.21875 32.234375 \r\nQ 47.125 39.59375 43.09375 43.984375 \r\nQ 39.0625 48.390625 32.421875 48.390625 \r\nQ 24.90625 48.390625 20.390625 44.140625 \r\nQ 15.875 39.890625 15.1875 32.171875 \r\nz\r\n\" id=\"DejaVuSans-101\"/>\r\n       <path d=\"M 45.40625 46.390625 \r\nL 45.40625 75.984375 \r\nL 54.390625 75.984375 \r\nL 54.390625 0 \r\nL 45.40625 0 \r\nL 45.40625 8.203125 \r\nQ 42.578125 3.328125 38.25 0.953125 \r\nQ 33.9375 -1.421875 27.875 -1.421875 \r\nQ 17.96875 -1.421875 11.734375 6.484375 \r\nQ 5.515625 14.40625 5.515625 27.296875 \r\nQ 5.515625 40.1875 11.734375 48.09375 \r\nQ 17.96875 56 27.875 56 \r\nQ 33.9375 56 38.25 53.625 \r\nQ 42.578125 51.265625 45.40625 46.390625 \r\nz\r\nM 14.796875 27.296875 \r\nQ 14.796875 17.390625 18.875 11.75 \r\nQ 22.953125 6.109375 30.078125 6.109375 \r\nQ 37.203125 6.109375 41.296875 11.75 \r\nQ 45.40625 17.390625 45.40625 27.296875 \r\nQ 45.40625 37.203125 41.296875 42.84375 \r\nQ 37.203125 48.484375 30.078125 48.484375 \r\nQ 22.953125 48.484375 18.875 42.84375 \r\nQ 14.796875 37.203125 14.796875 27.296875 \r\nz\r\n\" id=\"DejaVuSans-100\"/>\r\n       <path id=\"DejaVuSans-32\"/>\r\n       <path d=\"M 34.28125 27.484375 \r\nQ 23.390625 27.484375 19.1875 25 \r\nQ 14.984375 22.515625 14.984375 16.5 \r\nQ 14.984375 11.71875 18.140625 8.90625 \r\nQ 21.296875 6.109375 26.703125 6.109375 \r\nQ 34.1875 6.109375 38.703125 11.40625 \r\nQ 43.21875 16.703125 43.21875 25.484375 \r\nL 43.21875 27.484375 \r\nz\r\nM 52.203125 31.203125 \r\nL 52.203125 0 \r\nL 43.21875 0 \r\nL 43.21875 8.296875 \r\nQ 40.140625 3.328125 35.546875 0.953125 \r\nQ 30.953125 -1.421875 24.3125 -1.421875 \r\nQ 15.921875 -1.421875 10.953125 3.296875 \r\nQ 6 8.015625 6 15.921875 \r\nQ 6 25.140625 12.171875 29.828125 \r\nQ 18.359375 34.515625 30.609375 34.515625 \r\nL 43.21875 34.515625 \r\nL 43.21875 35.40625 \r\nQ 43.21875 41.609375 39.140625 45 \r\nQ 35.0625 48.390625 27.6875 48.390625 \r\nQ 23 48.390625 18.546875 47.265625 \r\nQ 14.109375 46.140625 10.015625 43.890625 \r\nL 10.015625 52.203125 \r\nQ 14.9375 54.109375 19.578125 55.046875 \r\nQ 24.21875 56 28.609375 56 \r\nQ 40.484375 56 46.34375 49.84375 \r\nQ 52.203125 43.703125 52.203125 31.203125 \r\nz\r\n\" id=\"DejaVuSans-97\"/>\r\n       <path d=\"M 9.421875 54.6875 \r\nL 18.40625 54.6875 \r\nL 18.40625 0 \r\nL 9.421875 0 \r\nz\r\nM 9.421875 75.984375 \r\nL 18.40625 75.984375 \r\nL 18.40625 64.59375 \r\nL 9.421875 64.59375 \r\nz\r\n\" id=\"DejaVuSans-105\"/>\r\n       <path d=\"M 54.890625 33.015625 \r\nL 54.890625 0 \r\nL 45.90625 0 \r\nL 45.90625 32.71875 \r\nQ 45.90625 40.484375 42.875 44.328125 \r\nQ 39.84375 48.1875 33.796875 48.1875 \r\nQ 26.515625 48.1875 22.3125 43.546875 \r\nQ 18.109375 38.921875 18.109375 30.90625 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 54.6875 \r\nL 18.109375 54.6875 \r\nL 18.109375 46.1875 \r\nQ 21.34375 51.125 25.703125 53.5625 \r\nQ 30.078125 56 35.796875 56 \r\nQ 45.21875 56 50.046875 50.171875 \r\nQ 54.890625 44.34375 54.890625 33.015625 \r\nz\r\n\" id=\"DejaVuSans-110\"/>\r\n       <path d=\"M 45.40625 27.984375 \r\nQ 45.40625 37.75 41.375 43.109375 \r\nQ 37.359375 48.484375 30.078125 48.484375 \r\nQ 22.859375 48.484375 18.828125 43.109375 \r\nQ 14.796875 37.75 14.796875 27.984375 \r\nQ 14.796875 18.265625 18.828125 12.890625 \r\nQ 22.859375 7.515625 30.078125 7.515625 \r\nQ 37.359375 7.515625 41.375 12.890625 \r\nQ 45.40625 18.265625 45.40625 27.984375 \r\nz\r\nM 54.390625 6.78125 \r\nQ 54.390625 -7.171875 48.1875 -13.984375 \r\nQ 42 -20.796875 29.203125 -20.796875 \r\nQ 24.46875 -20.796875 20.265625 -20.09375 \r\nQ 16.0625 -19.390625 12.109375 -17.921875 \r\nL 12.109375 -9.1875 \r\nQ 16.0625 -11.328125 19.921875 -12.34375 \r\nQ 23.78125 -13.375 27.78125 -13.375 \r\nQ 36.625 -13.375 41.015625 -8.765625 \r\nQ 45.40625 -4.15625 45.40625 5.171875 \r\nL 45.40625 9.625 \r\nQ 42.625 4.78125 38.28125 2.390625 \r\nQ 33.9375 0 27.875 0 \r\nQ 17.828125 0 11.671875 7.65625 \r\nQ 5.515625 15.328125 5.515625 27.984375 \r\nQ 5.515625 40.671875 11.671875 48.328125 \r\nQ 17.828125 56 27.875 56 \r\nQ 33.9375 56 38.28125 53.609375 \r\nQ 42.625 51.21875 45.40625 46.390625 \r\nL 45.40625 54.6875 \r\nL 54.390625 54.6875 \r\nz\r\n\" id=\"DejaVuSans-103\"/>\r\n       <path d=\"M 18.109375 8.203125 \r\nL 18.109375 -20.796875 \r\nL 9.078125 -20.796875 \r\nL 9.078125 54.6875 \r\nL 18.109375 54.6875 \r\nL 18.109375 46.390625 \r\nQ 20.953125 51.265625 25.265625 53.625 \r\nQ 29.59375 56 35.59375 56 \r\nQ 45.5625 56 51.78125 48.09375 \r\nQ 58.015625 40.1875 58.015625 27.296875 \r\nQ 58.015625 14.40625 51.78125 6.484375 \r\nQ 45.5625 -1.421875 35.59375 -1.421875 \r\nQ 29.59375 -1.421875 25.265625 0.953125 \r\nQ 20.953125 3.328125 18.109375 8.203125 \r\nz\r\nM 48.6875 27.296875 \r\nQ 48.6875 37.203125 44.609375 42.84375 \r\nQ 40.53125 48.484375 33.40625 48.484375 \r\nQ 26.265625 48.484375 22.1875 42.84375 \r\nQ 18.109375 37.203125 18.109375 27.296875 \r\nQ 18.109375 17.390625 22.1875 11.75 \r\nQ 26.265625 6.109375 33.40625 6.109375 \r\nQ 40.53125 6.109375 44.609375 11.75 \r\nQ 48.6875 17.390625 48.6875 27.296875 \r\nz\r\n\" id=\"DejaVuSans-112\"/>\r\n       <path d=\"M 8.5 21.578125 \r\nL 8.5 54.6875 \r\nL 17.484375 54.6875 \r\nL 17.484375 21.921875 \r\nQ 17.484375 14.15625 20.5 10.265625 \r\nQ 23.53125 6.390625 29.59375 6.390625 \r\nQ 36.859375 6.390625 41.078125 11.03125 \r\nQ 45.3125 15.671875 45.3125 23.6875 \r\nL 45.3125 54.6875 \r\nL 54.296875 54.6875 \r\nL 54.296875 0 \r\nL 45.3125 0 \r\nL 45.3125 8.40625 \r\nQ 42.046875 3.421875 37.71875 1 \r\nQ 33.40625 -1.421875 27.6875 -1.421875 \r\nQ 18.265625 -1.421875 13.375 4.4375 \r\nQ 8.5 10.296875 8.5 21.578125 \r\nz\r\nM 31.109375 56 \r\nz\r\n\" id=\"DejaVuSans-117\"/>\r\n       <path d=\"M 44.28125 53.078125 \r\nL 44.28125 44.578125 \r\nQ 40.484375 46.53125 36.375 47.5 \r\nQ 32.28125 48.484375 27.875 48.484375 \r\nQ 21.1875 48.484375 17.84375 46.4375 \r\nQ 14.5 44.390625 14.5 40.28125 \r\nQ 14.5 37.15625 16.890625 35.375 \r\nQ 19.28125 33.59375 26.515625 31.984375 \r\nL 29.59375 31.296875 \r\nQ 39.15625 29.25 43.1875 25.515625 \r\nQ 47.21875 21.78125 47.21875 15.09375 \r\nQ 47.21875 7.46875 41.1875 3.015625 \r\nQ 35.15625 -1.421875 24.609375 -1.421875 \r\nQ 20.21875 -1.421875 15.453125 -0.5625 \r\nQ 10.6875 0.296875 5.421875 2 \r\nL 5.421875 11.28125 \r\nQ 10.40625 8.6875 15.234375 7.390625 \r\nQ 20.0625 6.109375 24.8125 6.109375 \r\nQ 31.15625 6.109375 34.5625 8.28125 \r\nQ 37.984375 10.453125 37.984375 14.40625 \r\nQ 37.984375 18.0625 35.515625 20.015625 \r\nQ 33.0625 21.96875 24.703125 23.78125 \r\nL 21.578125 24.515625 \r\nQ 13.234375 26.265625 9.515625 29.90625 \r\nQ 5.8125 33.546875 5.8125 39.890625 \r\nQ 5.8125 47.609375 11.28125 51.796875 \r\nQ 16.75 56 26.8125 56 \r\nQ 31.78125 56 36.171875 55.265625 \r\nQ 40.578125 54.546875 44.28125 53.078125 \r\nz\r\n\" id=\"DejaVuSans-115\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-83\"/>\r\n      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-111\"/>\r\n      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-101\"/>\r\n      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-100\"/>\r\n      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-32\"/>\r\n      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"442.089844\" xlink:href=\"#DejaVuSans-97\"/>\r\n      <use x=\"503.369141\" xlink:href=\"#DejaVuSans-105\"/>\r\n      <use x=\"531.152344\" xlink:href=\"#DejaVuSans-110\"/>\r\n      <use x=\"594.53125\" xlink:href=\"#DejaVuSans-105\"/>\r\n      <use x=\"622.314453\" xlink:href=\"#DejaVuSans-110\"/>\r\n      <use x=\"685.693359\" xlink:href=\"#DejaVuSans-103\"/>\r\n      <use x=\"749.169922\" xlink:href=\"#DejaVuSans-32\"/>\r\n      <use x=\"780.957031\" xlink:href=\"#DejaVuSans-105\"/>\r\n      <use x=\"808.740234\" xlink:href=\"#DejaVuSans-110\"/>\r\n      <use x=\"872.119141\" xlink:href=\"#DejaVuSans-112\"/>\r\n      <use x=\"935.595703\" xlink:href=\"#DejaVuSans-117\"/>\r\n      <use x=\"998.974609\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"1038.183594\" xlink:href=\"#DejaVuSans-115\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"matplotlib.axis_2\">\r\n    <g id=\"ytick_1\">\r\n     <g id=\"line2d_4\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL -3.5 0 \r\n\" id=\"m2e61ac4440\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m2e61ac4440\" y=\"10.999219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_5\">\r\n      <!-- 0 -->\r\n      <g transform=\"translate(27.240625 14.798437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_2\">\r\n     <g id=\"line2d_5\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m2e61ac4440\" y=\"33.319219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_6\">\r\n      <!-- 10 -->\r\n      <g transform=\"translate(20.878125 37.118437)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 12.40625 8.296875 \r\nL 28.515625 8.296875 \r\nL 28.515625 63.921875 \r\nL 10.984375 60.40625 \r\nL 10.984375 69.390625 \r\nL 28.421875 72.90625 \r\nL 38.28125 72.90625 \r\nL 38.28125 8.296875 \r\nL 54.390625 8.296875 \r\nL 54.390625 0 \r\nL 12.40625 0 \r\nz\r\n\" id=\"DejaVuSans-49\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_3\">\r\n     <g id=\"line2d_6\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m2e61ac4440\" y=\"55.639219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_7\">\r\n      <!-- 20 -->\r\n      <g transform=\"translate(20.878125 59.438437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_4\">\r\n     <g id=\"line2d_7\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m2e61ac4440\" y=\"77.959219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_8\">\r\n      <!-- 30 -->\r\n      <g transform=\"translate(20.878125 81.758437)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 40.578125 39.3125 \r\nQ 47.65625 37.796875 51.625 33 \r\nQ 55.609375 28.21875 55.609375 21.1875 \r\nQ 55.609375 10.40625 48.1875 4.484375 \r\nQ 40.765625 -1.421875 27.09375 -1.421875 \r\nQ 22.515625 -1.421875 17.65625 -0.515625 \r\nQ 12.796875 0.390625 7.625 2.203125 \r\nL 7.625 11.71875 \r\nQ 11.71875 9.328125 16.59375 8.109375 \r\nQ 21.484375 6.890625 26.8125 6.890625 \r\nQ 36.078125 6.890625 40.9375 10.546875 \r\nQ 45.796875 14.203125 45.796875 21.1875 \r\nQ 45.796875 27.640625 41.28125 31.265625 \r\nQ 36.765625 34.90625 28.71875 34.90625 \r\nL 20.21875 34.90625 \r\nL 20.21875 43.015625 \r\nL 29.109375 43.015625 \r\nQ 36.375 43.015625 40.234375 45.921875 \r\nQ 44.09375 48.828125 44.09375 54.296875 \r\nQ 44.09375 59.90625 40.109375 62.90625 \r\nQ 36.140625 65.921875 28.71875 65.921875 \r\nQ 24.65625 65.921875 20.015625 65.03125 \r\nQ 15.375 64.15625 9.8125 62.3125 \r\nL 9.8125 71.09375 \r\nQ 15.4375 72.65625 20.34375 73.4375 \r\nQ 25.25 74.21875 29.59375 74.21875 \r\nQ 40.828125 74.21875 47.359375 69.109375 \r\nQ 53.90625 64.015625 53.90625 55.328125 \r\nQ 53.90625 49.265625 50.4375 45.09375 \r\nQ 46.96875 40.921875 40.578125 39.3125 \r\nz\r\n\" id=\"DejaVuSans-51\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-51\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_5\">\r\n     <g id=\"line2d_8\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m2e61ac4440\" y=\"100.279219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_9\">\r\n      <!-- 40 -->\r\n      <g transform=\"translate(20.878125 104.078437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_10\">\r\n     <!-- Sorted testing inputs -->\r\n     <g transform=\"translate(14.798438 118.160562)rotate(-90)scale(0.1 -0.1)\">\r\n      <use xlink:href=\"#DejaVuSans-83\"/>\r\n      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-111\"/>\r\n      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-101\"/>\r\n      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-100\"/>\r\n      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-32\"/>\r\n      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-101\"/>\r\n      <use x=\"462.5\" xlink:href=\"#DejaVuSans-115\"/>\r\n      <use x=\"514.599609\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"553.808594\" xlink:href=\"#DejaVuSans-105\"/>\r\n      <use x=\"581.591797\" xlink:href=\"#DejaVuSans-110\"/>\r\n      <use x=\"644.970703\" xlink:href=\"#DejaVuSans-103\"/>\r\n      <use x=\"708.447266\" xlink:href=\"#DejaVuSans-32\"/>\r\n      <use x=\"740.234375\" xlink:href=\"#DejaVuSans-105\"/>\r\n      <use x=\"768.017578\" xlink:href=\"#DejaVuSans-110\"/>\r\n      <use x=\"831.396484\" xlink:href=\"#DejaVuSans-112\"/>\r\n      <use x=\"894.873047\" xlink:href=\"#DejaVuSans-117\"/>\r\n      <use x=\"958.251953\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"997.460938\" xlink:href=\"#DejaVuSans-115\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"patch_3\">\r\n    <path d=\"M 40.603125 121.483219 \r\nL 40.603125 9.883219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_4\">\r\n    <path d=\"M 152.203125 121.483219 \r\nL 152.203125 9.883219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_5\">\r\n    <path d=\"M 40.603125 121.483219 \r\nL 152.203125 121.483219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_6\">\r\n    <path d=\"M 40.603125 9.883219 \r\nL 152.203125 9.883219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n  </g>\r\n  <g id=\"axes_2\">\r\n   <g id=\"patch_7\">\r\n    <path clip-path=\"url(#pc8f61084a3)\" d=\"M 159.178125 106.453219 \r\nL 159.178125 106.134703 \r\nL 159.178125 25.231734 \r\nL 159.178125 24.913219 \r\nL 163.255125 24.913219 \r\nL 163.255125 25.231734 \r\nL 163.255125 106.134703 \r\nL 163.255125 106.453219 \r\nz\r\n\" style=\"fill:#ffffff;stroke:#ffffff;stroke-linejoin:miter;stroke-width:0.01;\"/>\r\n   </g>\r\n   <image height=\"81\" id=\"imagebb3fd14c74\" transform=\"scale(1 -1)translate(0 -81)\" width=\"4\" x=\"159\" xlink:href=\"data:image/png;base64,\r\niVBORw0KGgoAAAANSUhEUgAAAAQAAABRCAYAAAD1sgc6AAAAnElEQVR4nJ2SOw7CUBADHxL3PykVFeyXFsaRLJFyNLY3UW77fOz5eu5n+gAMAYzVSJmIL1VQCdBY2Xwbw3eIsc1ISSTcika8QSB3BGf92/oVD1I+IX+HP0rZIcYGQXE25Q4HJscYWmrv6EJp9/6CahoFQyIppQTFSNuVGkaWswRFgNULQyNHDNchdwRPvzBQGmIQvKSUIHip3MHSD/5ryrXugEFNAAAAAElFTkSuQmCC\" y=\"-25\"/>\r\n   <g id=\"matplotlib.axis_3\"/>\r\n   <g id=\"matplotlib.axis_4\">\r\n    <g id=\"ytick_6\">\r\n     <g id=\"line2d_9\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL 3.5 0 \r\n\" id=\"m717b71fc39\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m717b71fc39\" y=\"85.09881\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_11\">\r\n      <!-- 0.02 -->\r\n      <g transform=\"translate(170.255125 88.898028)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 10.6875 12.40625 \r\nL 21 12.40625 \r\nL 21 0 \r\nL 10.6875 0 \r\nz\r\n\" id=\"DejaVuSans-46\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-50\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_7\">\r\n     <g id=\"line2d_10\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m717b71fc39\" y=\"63.744146\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_12\">\r\n      <!-- 0.04 -->\r\n      <g transform=\"translate(170.255125 67.543365)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-52\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_8\">\r\n     <g id=\"line2d_11\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m717b71fc39\" y=\"42.389482\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_13\">\r\n      <!-- 0.06 -->\r\n      <g transform=\"translate(170.255125 46.188701)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 33.015625 40.375 \r\nQ 26.375 40.375 22.484375 35.828125 \r\nQ 18.609375 31.296875 18.609375 23.390625 \r\nQ 18.609375 15.53125 22.484375 10.953125 \r\nQ 26.375 6.390625 33.015625 6.390625 \r\nQ 39.65625 6.390625 43.53125 10.953125 \r\nQ 47.40625 15.53125 47.40625 23.390625 \r\nQ 47.40625 31.296875 43.53125 35.828125 \r\nQ 39.65625 40.375 33.015625 40.375 \r\nz\r\nM 52.59375 71.296875 \r\nL 52.59375 62.3125 \r\nQ 48.875 64.0625 45.09375 64.984375 \r\nQ 41.3125 65.921875 37.59375 65.921875 \r\nQ 27.828125 65.921875 22.671875 59.328125 \r\nQ 17.53125 52.734375 16.796875 39.40625 \r\nQ 19.671875 43.65625 24.015625 45.921875 \r\nQ 28.375 48.1875 33.59375 48.1875 \r\nQ 44.578125 48.1875 50.953125 41.515625 \r\nQ 57.328125 34.859375 57.328125 23.390625 \r\nQ 57.328125 12.15625 50.6875 5.359375 \r\nQ 44.046875 -1.421875 33.015625 -1.421875 \r\nQ 20.359375 -1.421875 13.671875 8.265625 \r\nQ 6.984375 17.96875 6.984375 36.375 \r\nQ 6.984375 53.65625 15.1875 63.9375 \r\nQ 23.390625 74.21875 37.203125 74.21875 \r\nQ 40.921875 74.21875 44.703125 73.484375 \r\nQ 48.484375 72.75 52.59375 71.296875 \r\nz\r\n\" id=\"DejaVuSans-54\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-54\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"patch_8\">\r\n    <path d=\"M 159.178125 106.453219 \r\nL 159.178125 106.134703 \r\nL 159.178125 25.231734 \r\nL 159.178125 24.913219 \r\nL 163.255125 24.913219 \r\nL 163.255125 25.231734 \r\nL 163.255125 106.134703 \r\nL 163.255125 106.453219 \r\nz\r\n\" style=\"fill:none;stroke:#000000;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n  </g>\r\n </g>\r\n <defs>\r\n  <clipPath id=\"pebab890651\">\r\n   <rect height=\"111.6\" width=\"111.6\" x=\"40.603125\" y=\"9.883219\"/>\r\n  </clipPath>\r\n  <clipPath id=\"pc8f61084a3\">\r\n   <rect height=\"81.54\" width=\"4.077\" x=\"159.178125\" y=\"24.913219\"/>\r\n  </clipPath>\r\n </defs>\r\n</svg>\r\n",
      "text/plain": [
       "<Figure size 180x180 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "print(attention_weights.shape)\n",
    "d2l.show_heatmaps(attention_weights.unsqueeze(0).unsqueeze(0),\n",
    "                  xlabel='Sorted training inputs',\n",
    "                  ylabel='Sorted testing inputs')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 带参数的注意力汇聚\n",
    "\n",
    "非参数的Nadaraya-Waston核回归具有一致性的有点，如果拥有足够的效果，此模型会收敛到最优效果。\n",
    "\n",
    "尽管如此，我们还是可以轻松将可学习的参数集成到注意力汇聚中。\n",
    "\n",
    "![img](../img/attention_Gussion_kernel_into_attention2.jpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 批量矩阵乘法 "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "为了更有效地计算小批量数据的注意力，我们可以利用深度学习开发框架中提供的批量矩阵乘法。\n",
    "\n",
    "假设第一个小批量数据包含n个矩阵 ${X_1,...,X_n}$ ，形状为 $ {a\\times b} $ \n",
    "\n",
    "第二个小批量包含n个矩阵${Y_1,...,Y_n}$，形状为$ {b\\times c} $ \n",
    "\n",
    "它们的批量矩阵乘法得到n个矩阵${X_1Y_1,...,Y_nY_n}$形状为$ {a\\times c} $ \n",
    "\n",
    "因此，假定两个张量的形状分别是 ${(n,a,b)}$和${(n,b,c)}$，它们的批量乘法输出的形状为${(n,a,c)}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "torch.Size([2, 1, 6])"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X=torch.ones((2,1,4))\n",
    "Y=torch.ones((2,4,6))\n",
    "torch.bmm(X,Y).shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "在注意力机制的背景中，我们可以使用小批量矩阵乘法来计算小批量数据中的加权平均值。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [],
   "source": [
    "weights=torch.ones((2,10))*0.1\n",
    "values=torch.arange(20.0).reshape((2,10))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "torch.Size([2, 1, 10])"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights.unsqueeze(1).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[[0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000,\n",
       "          0.1000, 0.1000]],\n",
       "\n",
       "        [[0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000, 0.1000,\n",
       "          0.1000, 0.1000]]])"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weights.unsqueeze(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "torch.Size([2, 10, 1])"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "values.unsqueeze(-1).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[[ 0.],\n",
       "         [ 1.],\n",
       "         [ 2.],\n",
       "         [ 3.],\n",
       "         [ 4.],\n",
       "         [ 5.],\n",
       "         [ 6.],\n",
       "         [ 7.],\n",
       "         [ 8.],\n",
       "         [ 9.]],\n",
       "\n",
       "        [[10.],\n",
       "         [11.],\n",
       "         [12.],\n",
       "         [13.],\n",
       "         [14.],\n",
       "         [15.],\n",
       "         [16.],\n",
       "         [17.],\n",
       "         [18.],\n",
       "         [19.]]])"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "values.unsqueeze(-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "tensor([[[ 4.5000]],\n",
       "\n",
       "        [[14.5000]]])"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "torch.bmm(weights.unsqueeze(1),values.unsqueeze(-1))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 定义模型\n",
    "\n",
    "基于上边的带参数的注意力汇聚公式，使用小批量矩阵乘法，定义Nadaray-Watson核回归的带参数版本为："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [],
   "source": [
    "class NWkernelRegression(nn.Module):\n",
    "    def __init__(self, **kwargs):\n",
    "        super().__init__(**kwargs)\n",
    "        self.w=nn.Parameter(torch.rand(1,),requires_grad=True)\n",
    "    \n",
    "    #===============================================================================\n",
    "    # queries 是自主提示\n",
    "    # keys 是非自主提示\n",
    "    # 注意力机制是通过queries和keys结合在一起，实现对值（values），即感官输入，的选择倾向。\n",
    "    #===============================================================================\n",
    "    #\n",
    "    # queries->x_train\n",
    "    # keys->X_tile->x_train过滤出来的\n",
    "    # values->Y_tile->y_train过滤出来的\n",
    "    # l = loss(net(x_train, keys, values), y_train) / 2\n",
    "    def forward(self,queries,keys,values):\n",
    "        # queries 和 attention_weights 的形状为（查询个数，\"键——值\"对个数\n",
    "        queries=queries.repeat_interleave(keys.shape[1]).reshape((-1,keys.shape[1]))\n",
    "        self.attention_weights=nn.functional.softmax(-((queries - keys) * self.w)**2 / 2, dim=1)\n",
    "        \n",
    "        print(queries.shape)\n",
    "        print(self.attention_weights.shape)\n",
    "\n",
    "        # print()\n",
    "\n",
    "        # values的shpae为（查询个数，键——值对个数）\n",
    "        return torch.bmm(self.attention_weights.unsqueeze(1),values.unsqueeze(-1)).reshape(-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function repeat_interleave:\n",
      "\n",
      "repeat_interleave(...)\n",
      "    repeat_interleave(input, repeats, dim=None, *, output_size=None) -> Tensor\n",
      "    \n",
      "    Repeat elements of a tensor.\n",
      "    \n",
      "    .. warning::\n",
      "    \n",
      "        This is different from :meth:`torch.Tensor.repeat` but similar to ``numpy.repeat``.\n",
      "    \n",
      "    Args:\n",
      "        input (Tensor): the input tensor.\n",
      "        repeats (Tensor or int): The number of repetitions for each element.\n",
      "            repeats is broadcasted to fit the shape of the given axis.\n",
      "        dim (int, optional): The dimension along which to repeat values.\n",
      "            By default, use the flattened input array, and return a flat output\n",
      "            array.\n",
      "    \n",
      "    Keyword args:\n",
      "        output_size (int, optional): Total output size for the given axis\n",
      "            ( e.g. sum of repeats). If given, it will avoid stream syncronization\n",
      "            needed to calculate output shape of the tensor.\n",
      "    \n",
      "    Returns:\n",
      "        Tensor: Repeated tensor which has the same shape as input, except along the given axis.\n",
      "    \n",
      "    Example::\n",
      "    \n",
      "        >>> x = torch.tensor([1, 2, 3])\n",
      "        >>> x.repeat_interleave(2)\n",
      "        tensor([1, 1, 2, 2, 3, 3])\n",
      "        >>> y = torch.tensor([[1, 2], [3, 4]])\n",
      "        >>> torch.repeat_interleave(y, 2)\n",
      "        tensor([1, 1, 2, 2, 3, 3, 4, 4])\n",
      "        >>> torch.repeat_interleave(y, 3, dim=1)\n",
      "        tensor([[1, 1, 1, 2, 2, 2],\n",
      "                [3, 3, 3, 4, 4, 4]])\n",
      "        >>> torch.repeat_interleave(y, torch.tensor([1, 2]), dim=0)\n",
      "        tensor([[1, 2],\n",
      "                [3, 4],\n",
      "                [3, 4]])\n",
      "        >>> torch.repeat_interleave(y, torch.tensor([1, 2]), dim=0, output_size=3)\n",
      "        tensor([[1, 2],\n",
      "                [3, 4],\n",
      "                [3, 4]])\n",
      "    \n",
      "    .. function:: repeat_interleave(repeats, *, output_size=None) -> Tensor\n",
      "       :noindex:\n",
      "    \n",
      "    If the `repeats` is `tensor([n1, n2, n3, ...])`, then the output will be\n",
      "    `tensor([0, 0, ..., 1, 1, ..., 2, 2, ..., ...])` where `0` appears `n1` times,\n",
      "    `1` appears `n2` times, `2` appears `n3` times, etc.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(torch.repeat_interleave)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x_train tensor([0.0619, 0.1135, 0.1557, 0.2257, 0.2347, 0.2395, 0.4284, 0.4727, 0.5260,\n",
      "        0.5291, 0.5655, 0.6177, 0.7200, 0.8485, 1.1942, 1.2542, 1.4317, 1.4330,\n",
      "        1.5729, 1.6898, 1.7111, 1.7288, 1.8538, 2.1765, 2.2484, 2.3017, 2.4152,\n",
      "        2.6576, 2.7019, 2.7705, 2.8034, 2.8767, 2.9468, 3.0591, 3.1667, 3.4462,\n",
      "        3.6263, 3.6306, 4.0156, 4.0641, 4.2493, 4.2671, 4.2677, 4.4630, 4.5480,\n",
      "        4.6018, 4.6705, 4.7529, 4.9587, 4.9970])\n",
      "y_train tensor([0.5421, 0.7437, 0.9176, 1.0163, 1.1694, 1.1966, 1.3155, 2.0782, 1.9361,\n",
      "        0.6492, 1.7355, 2.3411, 3.0437, 2.4192, 2.5545, 3.8041, 2.5185, 3.6042,\n",
      "        3.0581, 3.7228, 3.3841, 4.0570, 3.7821, 2.7344, 3.9488, 3.5073, 3.7979,\n",
      "        2.3981, 2.4439, 3.4054, 2.4014, 3.1587, 2.1073, 3.2100, 2.6753, 2.9519,\n",
      "        2.7963, 1.9527, 0.7686, 0.7043, 1.5081, 1.4440, 1.5037, 2.1492, 1.2576,\n",
      "        0.9285, 1.5408, 1.0211, 2.0849, 0.9409])\n",
      "X_tile tensor([[0.0619, 0.1135, 0.1557,  ..., 4.7529, 4.9587, 4.9970],\n",
      "        [0.0619, 0.1135, 0.1557,  ..., 4.7529, 4.9587, 4.9970],\n",
      "        [0.0619, 0.1135, 0.1557,  ..., 4.7529, 4.9587, 4.9970],\n",
      "        ...,\n",
      "        [0.0619, 0.1135, 0.1557,  ..., 4.7529, 4.9587, 4.9970],\n",
      "        [0.0619, 0.1135, 0.1557,  ..., 4.7529, 4.9587, 4.9970],\n",
      "        [0.0619, 0.1135, 0.1557,  ..., 4.7529, 4.9587, 4.9970]])\n",
      "Y_tile tensor([[0.5421, 0.7437, 0.9176,  ..., 1.0211, 2.0849, 0.9409],\n",
      "        [0.5421, 0.7437, 0.9176,  ..., 1.0211, 2.0849, 0.9409],\n",
      "        [0.5421, 0.7437, 0.9176,  ..., 1.0211, 2.0849, 0.9409],\n",
      "        ...,\n",
      "        [0.5421, 0.7437, 0.9176,  ..., 1.0211, 2.0849, 0.9409],\n",
      "        [0.5421, 0.7437, 0.9176,  ..., 1.0211, 2.0849, 0.9409],\n",
      "        [0.5421, 0.7437, 0.9176,  ..., 1.0211, 2.0849, 0.9409]])\n",
      "torch.Size([50])\n",
      "torch.Size([50])\n",
      "torch.Size([50, 50])\n",
      "torch.Size([50, 50])\n",
      "torch.Size([50, 49])\n",
      "torch.Size([50, 49])\n"
     ]
    }
   ],
   "source": [
    "# X_tile 的形状：(n_train,n_train) 每一行包含着相同的训练输入\n",
    "# repeat在第0维将一行重复50遍，列只重复一遍\n",
    "X_tile=x_train.repeat((n_train,1))\n",
    "\n",
    "# Y_tile 的形状：(n_train,n_train) 每一行都包含着相同的训练输出\n",
    "Y_tile=y_train.repeat((n_train,1))\n",
    "\n",
    "# keys的形状：(n_train,n_train-1)\n",
    "keys=X_tile[ (1 - torch.eye(n_train)).type(torch.bool) ].reshape((n_train,-1))\n",
    "\n",
    "# values的形状：(n_train,n_train-1)\n",
    "values=Y_tile[(1 - torch.eye(n_train)).type(torch.bool)].reshape((n_train, -1))\n",
    "\n",
    "print(\"x_train\",x_train)\n",
    "print(\"y_train\",y_train)\n",
    "print(\"X_tile\",X_tile)\n",
    "print(\"Y_tile\",Y_tile)\n",
    "\n",
    "print(x_train.shape)\n",
    "print(y_train.shape)\n",
    "print(X_tile.shape)\n",
    "print(Y_tile.shape)\n",
    "print(keys.shape)\n",
    "print(values.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "torch.Size([2450])"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 通过1 - torch.eye(n_train)).type(torch.bool) 把X_tile给过滤了\n",
    "X_tile [(1 - torch.eye(n_train)).type(torch.bool)].shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Parameter containing:\n",
      "tensor([37.1043], requires_grad=True)\n"
     ]
    }
   ],
   "source": [
    "for x in net.parameters():\n",
    "    print(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"180.696298pt\" version=\"1.1\" viewBox=\"0 0 246.284375 180.696298\" width=\"246.284375pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n   <cc:Work>\r\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n    <dc:date>2021-11-26T11:00:50.713340</dc:date>\r\n    <dc:format>image/svg+xml</dc:format>\r\n    <dc:creator>\r\n     <cc:Agent>\r\n      <dc:title>Matplotlib v3.3.4, https://matplotlib.org/</dc:title>\r\n     </cc:Agent>\r\n    </dc:creator>\r\n   </cc:Work>\r\n  </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n  <g id=\"patch_1\">\r\n   <path d=\"M 0 180.696298 \r\nL 246.284375 180.696298 \r\nL 246.284375 -0 \r\nL 0 -0 \r\nz\r\n\" style=\"fill:none;\"/>\r\n  </g>\r\n  <g id=\"axes_1\">\r\n   <g id=\"patch_2\">\r\n    <path d=\"M 40.603125 143.140048 \r\nL 235.903125 143.140048 \r\nL 235.903125 7.240048 \r\nL 40.603125 7.240048 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n   </g>\r\n   <g id=\"matplotlib.axis_1\">\r\n    <g id=\"xtick_1\">\r\n     <g id=\"line2d_1\">\r\n      <path clip-path=\"url(#p8ffa38a401)\" d=\"M 40.603125 143.140048 \r\nL 40.603125 7.240048 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_2\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL 0 3.5 \r\n\" id=\"m5c38656664\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m5c38656664\" y=\"143.140048\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_1\">\r\n      <!-- 1 -->\r\n      <g transform=\"translate(37.421875 157.738486)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 12.40625 8.296875 \r\nL 28.515625 8.296875 \r\nL 28.515625 63.921875 \r\nL 10.984375 60.40625 \r\nL 10.984375 69.390625 \r\nL 28.421875 72.90625 \r\nL 38.28125 72.90625 \r\nL 38.28125 8.296875 \r\nL 54.390625 8.296875 \r\nL 54.390625 0 \r\nL 12.40625 0 \r\nz\r\n\" id=\"DejaVuSans-49\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_2\">\r\n     <g id=\"line2d_3\">\r\n      <path clip-path=\"url(#p8ffa38a401)\" d=\"M 89.428125 143.140048 \r\nL 89.428125 7.240048 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_4\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"89.428125\" xlink:href=\"#m5c38656664\" y=\"143.140048\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_2\">\r\n      <!-- 2 -->\r\n      <g transform=\"translate(86.246875 157.738486)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 19.1875 8.296875 \r\nL 53.609375 8.296875 \r\nL 53.609375 0 \r\nL 7.328125 0 \r\nL 7.328125 8.296875 \r\nQ 12.9375 14.109375 22.625 23.890625 \r\nQ 32.328125 33.6875 34.8125 36.53125 \r\nQ 39.546875 41.84375 41.421875 45.53125 \r\nQ 43.3125 49.21875 43.3125 52.78125 \r\nQ 43.3125 58.59375 39.234375 62.25 \r\nQ 35.15625 65.921875 28.609375 65.921875 \r\nQ 23.96875 65.921875 18.8125 64.3125 \r\nQ 13.671875 62.703125 7.8125 59.421875 \r\nL 7.8125 69.390625 \r\nQ 13.765625 71.78125 18.9375 73 \r\nQ 24.125 74.21875 28.421875 74.21875 \r\nQ 39.75 74.21875 46.484375 68.546875 \r\nQ 53.21875 62.890625 53.21875 53.421875 \r\nQ 53.21875 48.921875 51.53125 44.890625 \r\nQ 49.859375 40.875 45.40625 35.40625 \r\nQ 44.1875 33.984375 37.640625 27.21875 \r\nQ 31.109375 20.453125 19.1875 8.296875 \r\nz\r\n\" id=\"DejaVuSans-50\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_3\">\r\n     <g id=\"line2d_5\">\r\n      <path clip-path=\"url(#p8ffa38a401)\" d=\"M 138.253125 143.140048 \r\nL 138.253125 7.240048 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_6\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"138.253125\" xlink:href=\"#m5c38656664\" y=\"143.140048\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_3\">\r\n      <!-- 3 -->\r\n      <g transform=\"translate(135.071875 157.738486)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 40.578125 39.3125 \r\nQ 47.65625 37.796875 51.625 33 \r\nQ 55.609375 28.21875 55.609375 21.1875 \r\nQ 55.609375 10.40625 48.1875 4.484375 \r\nQ 40.765625 -1.421875 27.09375 -1.421875 \r\nQ 22.515625 -1.421875 17.65625 -0.515625 \r\nQ 12.796875 0.390625 7.625 2.203125 \r\nL 7.625 11.71875 \r\nQ 11.71875 9.328125 16.59375 8.109375 \r\nQ 21.484375 6.890625 26.8125 6.890625 \r\nQ 36.078125 6.890625 40.9375 10.546875 \r\nQ 45.796875 14.203125 45.796875 21.1875 \r\nQ 45.796875 27.640625 41.28125 31.265625 \r\nQ 36.765625 34.90625 28.71875 34.90625 \r\nL 20.21875 34.90625 \r\nL 20.21875 43.015625 \r\nL 29.109375 43.015625 \r\nQ 36.375 43.015625 40.234375 45.921875 \r\nQ 44.09375 48.828125 44.09375 54.296875 \r\nQ 44.09375 59.90625 40.109375 62.90625 \r\nQ 36.140625 65.921875 28.71875 65.921875 \r\nQ 24.65625 65.921875 20.015625 65.03125 \r\nQ 15.375 64.15625 9.8125 62.3125 \r\nL 9.8125 71.09375 \r\nQ 15.4375 72.65625 20.34375 73.4375 \r\nQ 25.25 74.21875 29.59375 74.21875 \r\nQ 40.828125 74.21875 47.359375 69.109375 \r\nQ 53.90625 64.015625 53.90625 55.328125 \r\nQ 53.90625 49.265625 50.4375 45.09375 \r\nQ 46.96875 40.921875 40.578125 39.3125 \r\nz\r\n\" id=\"DejaVuSans-51\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-51\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_4\">\r\n     <g id=\"line2d_7\">\r\n      <path clip-path=\"url(#p8ffa38a401)\" d=\"M 187.078125 143.140048 \r\nL 187.078125 7.240048 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_8\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"187.078125\" xlink:href=\"#m5c38656664\" y=\"143.140048\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_4\">\r\n      <!-- 4 -->\r\n      <g transform=\"translate(183.896875 157.738486)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 37.796875 64.3125 \r\nL 12.890625 25.390625 \r\nL 37.796875 25.390625 \r\nz\r\nM 35.203125 72.90625 \r\nL 47.609375 72.90625 \r\nL 47.609375 25.390625 \r\nL 58.015625 25.390625 \r\nL 58.015625 17.1875 \r\nL 47.609375 17.1875 \r\nL 47.609375 0 \r\nL 37.796875 0 \r\nL 37.796875 17.1875 \r\nL 4.890625 17.1875 \r\nL 4.890625 26.703125 \r\nz\r\n\" id=\"DejaVuSans-52\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_5\">\r\n     <g id=\"line2d_9\">\r\n      <path clip-path=\"url(#p8ffa38a401)\" d=\"M 235.903125 143.140048 \r\nL 235.903125 7.240048 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_10\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"235.903125\" xlink:href=\"#m5c38656664\" y=\"143.140048\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_5\">\r\n      <!-- 5 -->\r\n      <g transform=\"translate(232.721875 157.738486)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 10.796875 72.90625 \r\nL 49.515625 72.90625 \r\nL 49.515625 64.59375 \r\nL 19.828125 64.59375 \r\nL 19.828125 46.734375 \r\nQ 21.96875 47.46875 24.109375 47.828125 \r\nQ 26.265625 48.1875 28.421875 48.1875 \r\nQ 40.625 48.1875 47.75 41.5 \r\nQ 54.890625 34.8125 54.890625 23.390625 \r\nQ 54.890625 11.625 47.5625 5.09375 \r\nQ 40.234375 -1.421875 26.90625 -1.421875 \r\nQ 22.3125 -1.421875 17.546875 -0.640625 \r\nQ 12.796875 0.140625 7.71875 1.703125 \r\nL 7.71875 11.625 \r\nQ 12.109375 9.234375 16.796875 8.0625 \r\nQ 21.484375 6.890625 26.703125 6.890625 \r\nQ 35.15625 6.890625 40.078125 11.328125 \r\nQ 45.015625 15.765625 45.015625 23.390625 \r\nQ 45.015625 31 40.078125 35.4375 \r\nQ 35.15625 39.890625 26.703125 39.890625 \r\nQ 22.75 39.890625 18.8125 39.015625 \r\nQ 14.890625 38.140625 10.796875 36.28125 \r\nz\r\n\" id=\"DejaVuSans-53\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_6\">\r\n     <!-- epoch -->\r\n     <g transform=\"translate(123.025 171.416611)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 56.203125 29.59375 \r\nL 56.203125 25.203125 \r\nL 14.890625 25.203125 \r\nQ 15.484375 15.921875 20.484375 11.0625 \r\nQ 25.484375 6.203125 34.421875 6.203125 \r\nQ 39.59375 6.203125 44.453125 7.46875 \r\nQ 49.3125 8.734375 54.109375 11.28125 \r\nL 54.109375 2.78125 \r\nQ 49.265625 0.734375 44.1875 -0.34375 \r\nQ 39.109375 -1.421875 33.890625 -1.421875 \r\nQ 20.796875 -1.421875 13.15625 6.1875 \r\nQ 5.515625 13.8125 5.515625 26.8125 \r\nQ 5.515625 40.234375 12.765625 48.109375 \r\nQ 20.015625 56 32.328125 56 \r\nQ 43.359375 56 49.78125 48.890625 \r\nQ 56.203125 41.796875 56.203125 29.59375 \r\nz\r\nM 47.21875 32.234375 \r\nQ 47.125 39.59375 43.09375 43.984375 \r\nQ 39.0625 48.390625 32.421875 48.390625 \r\nQ 24.90625 48.390625 20.390625 44.140625 \r\nQ 15.875 39.890625 15.1875 32.171875 \r\nz\r\n\" id=\"DejaVuSans-101\"/>\r\n       <path d=\"M 18.109375 8.203125 \r\nL 18.109375 -20.796875 \r\nL 9.078125 -20.796875 \r\nL 9.078125 54.6875 \r\nL 18.109375 54.6875 \r\nL 18.109375 46.390625 \r\nQ 20.953125 51.265625 25.265625 53.625 \r\nQ 29.59375 56 35.59375 56 \r\nQ 45.5625 56 51.78125 48.09375 \r\nQ 58.015625 40.1875 58.015625 27.296875 \r\nQ 58.015625 14.40625 51.78125 6.484375 \r\nQ 45.5625 -1.421875 35.59375 -1.421875 \r\nQ 29.59375 -1.421875 25.265625 0.953125 \r\nQ 20.953125 3.328125 18.109375 8.203125 \r\nz\r\nM 48.6875 27.296875 \r\nQ 48.6875 37.203125 44.609375 42.84375 \r\nQ 40.53125 48.484375 33.40625 48.484375 \r\nQ 26.265625 48.484375 22.1875 42.84375 \r\nQ 18.109375 37.203125 18.109375 27.296875 \r\nQ 18.109375 17.390625 22.1875 11.75 \r\nQ 26.265625 6.109375 33.40625 6.109375 \r\nQ 40.53125 6.109375 44.609375 11.75 \r\nQ 48.6875 17.390625 48.6875 27.296875 \r\nz\r\n\" id=\"DejaVuSans-112\"/>\r\n       <path d=\"M 30.609375 48.390625 \r\nQ 23.390625 48.390625 19.1875 42.75 \r\nQ 14.984375 37.109375 14.984375 27.296875 \r\nQ 14.984375 17.484375 19.15625 11.84375 \r\nQ 23.34375 6.203125 30.609375 6.203125 \r\nQ 37.796875 6.203125 41.984375 11.859375 \r\nQ 46.1875 17.53125 46.1875 27.296875 \r\nQ 46.1875 37.015625 41.984375 42.703125 \r\nQ 37.796875 48.390625 30.609375 48.390625 \r\nz\r\nM 30.609375 56 \r\nQ 42.328125 56 49.015625 48.375 \r\nQ 55.71875 40.765625 55.71875 27.296875 \r\nQ 55.71875 13.875 49.015625 6.21875 \r\nQ 42.328125 -1.421875 30.609375 -1.421875 \r\nQ 18.84375 -1.421875 12.171875 6.21875 \r\nQ 5.515625 13.875 5.515625 27.296875 \r\nQ 5.515625 40.765625 12.171875 48.375 \r\nQ 18.84375 56 30.609375 56 \r\nz\r\n\" id=\"DejaVuSans-111\"/>\r\n       <path d=\"M 48.78125 52.59375 \r\nL 48.78125 44.1875 \r\nQ 44.96875 46.296875 41.140625 47.34375 \r\nQ 37.3125 48.390625 33.40625 48.390625 \r\nQ 24.65625 48.390625 19.8125 42.84375 \r\nQ 14.984375 37.3125 14.984375 27.296875 \r\nQ 14.984375 17.28125 19.8125 11.734375 \r\nQ 24.65625 6.203125 33.40625 6.203125 \r\nQ 37.3125 6.203125 41.140625 7.25 \r\nQ 44.96875 8.296875 48.78125 10.40625 \r\nL 48.78125 2.09375 \r\nQ 45.015625 0.34375 40.984375 -0.53125 \r\nQ 36.96875 -1.421875 32.421875 -1.421875 \r\nQ 20.0625 -1.421875 12.78125 6.34375 \r\nQ 5.515625 14.109375 5.515625 27.296875 \r\nQ 5.515625 40.671875 12.859375 48.328125 \r\nQ 20.21875 56 33.015625 56 \r\nQ 37.15625 56 41.109375 55.140625 \r\nQ 45.0625 54.296875 48.78125 52.59375 \r\nz\r\n\" id=\"DejaVuSans-99\"/>\r\n       <path d=\"M 54.890625 33.015625 \r\nL 54.890625 0 \r\nL 45.90625 0 \r\nL 45.90625 32.71875 \r\nQ 45.90625 40.484375 42.875 44.328125 \r\nQ 39.84375 48.1875 33.796875 48.1875 \r\nQ 26.515625 48.1875 22.3125 43.546875 \r\nQ 18.109375 38.921875 18.109375 30.90625 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 75.984375 \r\nL 18.109375 75.984375 \r\nL 18.109375 46.1875 \r\nQ 21.34375 51.125 25.703125 53.5625 \r\nQ 30.078125 56 35.796875 56 \r\nQ 45.21875 56 50.046875 50.171875 \r\nQ 54.890625 44.34375 54.890625 33.015625 \r\nz\r\n\" id=\"DejaVuSans-104\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-101\"/>\r\n      <use x=\"61.523438\" xlink:href=\"#DejaVuSans-112\"/>\r\n      <use x=\"125\" xlink:href=\"#DejaVuSans-111\"/>\r\n      <use x=\"186.181641\" xlink:href=\"#DejaVuSans-99\"/>\r\n      <use x=\"241.162109\" xlink:href=\"#DejaVuSans-104\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"matplotlib.axis_2\">\r\n    <g id=\"ytick_1\">\r\n     <g id=\"line2d_11\">\r\n      <path clip-path=\"url(#p8ffa38a401)\" d=\"M 40.603125 113.52965 \r\nL 235.903125 113.52965 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_12\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL -3.5 0 \r\n\" id=\"m3d1f6a0bda\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m3d1f6a0bda\" y=\"113.52965\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_7\">\r\n      <!-- 5 -->\r\n      <g transform=\"translate(27.240625 117.328869)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_2\">\r\n     <g id=\"line2d_13\">\r\n      <path clip-path=\"url(#p8ffa38a401)\" d=\"M 40.603125 79.35284 \r\nL 235.903125 79.35284 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_14\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m3d1f6a0bda\" y=\"79.35284\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_8\">\r\n      <!-- 10 -->\r\n      <g transform=\"translate(20.878125 83.152058)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 31.78125 66.40625 \r\nQ 24.171875 66.40625 20.328125 58.90625 \r\nQ 16.5 51.421875 16.5 36.375 \r\nQ 16.5 21.390625 20.328125 13.890625 \r\nQ 24.171875 6.390625 31.78125 6.390625 \r\nQ 39.453125 6.390625 43.28125 13.890625 \r\nQ 47.125 21.390625 47.125 36.375 \r\nQ 47.125 51.421875 43.28125 58.90625 \r\nQ 39.453125 66.40625 31.78125 66.40625 \r\nz\r\nM 31.78125 74.21875 \r\nQ 44.046875 74.21875 50.515625 64.515625 \r\nQ 56.984375 54.828125 56.984375 36.375 \r\nQ 56.984375 17.96875 50.515625 8.265625 \r\nQ 44.046875 -1.421875 31.78125 -1.421875 \r\nQ 19.53125 -1.421875 13.0625 8.265625 \r\nQ 6.59375 17.96875 6.59375 36.375 \r\nQ 6.59375 54.828125 13.0625 64.515625 \r\nQ 19.53125 74.21875 31.78125 74.21875 \r\nz\r\n\" id=\"DejaVuSans-48\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_3\">\r\n     <g id=\"line2d_15\">\r\n      <path clip-path=\"url(#p8ffa38a401)\" d=\"M 40.603125 45.176029 \r\nL 235.903125 45.176029 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_16\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m3d1f6a0bda\" y=\"45.176029\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_9\">\r\n      <!-- 15 -->\r\n      <g transform=\"translate(20.878125 48.975248)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_4\">\r\n     <g id=\"line2d_17\">\r\n      <path clip-path=\"url(#p8ffa38a401)\" d=\"M 40.603125 10.999219 \r\nL 235.903125 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_18\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#m3d1f6a0bda\" y=\"10.999219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_10\">\r\n      <!-- 20 -->\r\n      <g transform=\"translate(20.878125 14.798437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_11\">\r\n     <!-- loss -->\r\n     <g transform=\"translate(14.798437 84.847861)rotate(-90)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 9.421875 75.984375 \r\nL 18.40625 75.984375 \r\nL 18.40625 0 \r\nL 9.421875 0 \r\nz\r\n\" id=\"DejaVuSans-108\"/>\r\n       <path d=\"M 44.28125 53.078125 \r\nL 44.28125 44.578125 \r\nQ 40.484375 46.53125 36.375 47.5 \r\nQ 32.28125 48.484375 27.875 48.484375 \r\nQ 21.1875 48.484375 17.84375 46.4375 \r\nQ 14.5 44.390625 14.5 40.28125 \r\nQ 14.5 37.15625 16.890625 35.375 \r\nQ 19.28125 33.59375 26.515625 31.984375 \r\nL 29.59375 31.296875 \r\nQ 39.15625 29.25 43.1875 25.515625 \r\nQ 47.21875 21.78125 47.21875 15.09375 \r\nQ 47.21875 7.46875 41.1875 3.015625 \r\nQ 35.15625 -1.421875 24.609375 -1.421875 \r\nQ 20.21875 -1.421875 15.453125 -0.5625 \r\nQ 10.6875 0.296875 5.421875 2 \r\nL 5.421875 11.28125 \r\nQ 10.40625 8.6875 15.234375 7.390625 \r\nQ 20.0625 6.109375 24.8125 6.109375 \r\nQ 31.15625 6.109375 34.5625 8.28125 \r\nQ 37.984375 10.453125 37.984375 14.40625 \r\nQ 37.984375 18.0625 35.515625 20.015625 \r\nQ 33.0625 21.96875 24.703125 23.78125 \r\nL 21.578125 24.515625 \r\nQ 13.234375 26.265625 9.515625 29.90625 \r\nQ 5.8125 33.546875 5.8125 39.890625 \r\nQ 5.8125 47.609375 11.28125 51.796875 \r\nQ 16.75 56 26.8125 56 \r\nQ 31.78125 56 36.171875 55.265625 \r\nQ 40.578125 54.546875 44.28125 53.078125 \r\nz\r\n\" id=\"DejaVuSans-115\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-108\"/>\r\n      <use x=\"27.783203\" xlink:href=\"#DejaVuSans-111\"/>\r\n      <use x=\"88.964844\" xlink:href=\"#DejaVuSans-115\"/>\r\n      <use x=\"141.064453\" xlink:href=\"#DejaVuSans-115\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"line2d_19\">\r\n    <path clip-path=\"url(#p8ffa38a401)\" d=\"M 40.603125 13.417321 \r\nL 89.428125 86.066498 \r\nL 138.253125 110.099691 \r\nL 187.078125 117.041419 \r\nL 235.903125 119.442025 \r\nL 247.284375 119.71685 \r\nL 247.284375 119.71685 \r\n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n   </g>\r\n   <g id=\"patch_3\">\r\n    <path d=\"M 40.603125 143.140048 \r\nL 40.603125 7.240048 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_4\">\r\n    <path d=\"M 235.903125 143.140048 \r\nL 235.903125 7.240048 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_5\">\r\n    <path d=\"M 40.603125 143.140048 \r\nL 235.903125 143.140048 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_6\">\r\n    <path d=\"M 40.603125 7.240048 \r\nL 235.903125 7.240048 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n  </g>\r\n </g>\r\n <defs>\r\n  <clipPath id=\"p8ffa38a401\">\r\n   <rect height=\"135.9\" width=\"195.3\" x=\"40.603125\" y=\"7.240048\"/>\r\n  </clipPath>\r\n </defs>\r\n</svg>\r\n",
      "text/plain": [
       "<Figure size 252x180 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "net = NWkernelRegression()\n",
    "\n",
    "# Mean Square Error Loss\n",
    "loss = nn.MSELoss(reduction='none')\n",
    "\n",
    "# 将net所涉及的参数丢给trainer\n",
    "trainer = torch.optim.Adam(net.parameters(), lr=0.8)\n",
    "animator = d2l.Animator(xlabel='epoch', ylabel='loss', xlim=[1, 5])\n",
    "\n",
    "for epoch in range(1000):\n",
    "    trainer.zero_grad()\n",
    "    # 注意：L2 Loss = 1/2 * MSE Loss。\n",
    "    # PyTorch 的 MSE Loss 与 MXNet 的 L2Loss 差一个 2 的因子，因此被除2。\n",
    "    l = loss(net(x_train, keys, values), y_train) / 2\n",
    "    l.sum().backward()\n",
    "    trainer.step()\n",
    "    print(f'epoch {epoch + 1}, loss {float(l.sum()):.6f}')\n",
    "    animator.add(epoch + 1, float(l.sum()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.Size([50, 50])\n",
      "torch.Size([50, 50])\n",
      "torch.Size([50, 1])\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"184.455469pt\" version=\"1.1\" viewBox=\"0 0 248.301563 184.455469\" width=\"248.301563pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n   <cc:Work>\r\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n    <dc:date>2021-11-26T11:19:51.554486</dc:date>\r\n    <dc:format>image/svg+xml</dc:format>\r\n    <dc:creator>\r\n     <cc:Agent>\r\n      <dc:title>Matplotlib v3.3.4, https://matplotlib.org/</dc:title>\r\n     </cc:Agent>\r\n    </dc:creator>\r\n   </cc:Work>\r\n  </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n  <g id=\"patch_1\">\r\n   <path d=\"M 0 184.455469 \r\nL 248.301563 184.455469 \r\nL 248.301563 -0 \r\nL 0 -0 \r\nz\r\n\" style=\"fill:none;\"/>\r\n  </g>\r\n  <g id=\"axes_1\">\r\n   <g id=\"patch_2\">\r\n    <path d=\"M 42.620312 146.899219 \r\nL 237.920313 146.899219 \r\nL 237.920313 10.999219 \r\nL 42.620312 10.999219 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n   </g>\r\n   <g id=\"matplotlib.axis_1\">\r\n    <g id=\"xtick_1\">\r\n     <g id=\"line2d_1\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 42.620312 146.899219 \r\nL 42.620312 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_2\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL 0 3.5 \r\n\" id=\"m7b9e389e2e\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#m7b9e389e2e\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_1\">\r\n      <!-- 0 -->\r\n      <g transform=\"translate(39.439062 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 31.78125 66.40625 \r\nQ 24.171875 66.40625 20.328125 58.90625 \r\nQ 16.5 51.421875 16.5 36.375 \r\nQ 16.5 21.390625 20.328125 13.890625 \r\nQ 24.171875 6.390625 31.78125 6.390625 \r\nQ 39.453125 6.390625 43.28125 13.890625 \r\nQ 47.125 21.390625 47.125 36.375 \r\nQ 47.125 51.421875 43.28125 58.90625 \r\nQ 39.453125 66.40625 31.78125 66.40625 \r\nz\r\nM 31.78125 74.21875 \r\nQ 44.046875 74.21875 50.515625 64.515625 \r\nQ 56.984375 54.828125 56.984375 36.375 \r\nQ 56.984375 17.96875 50.515625 8.265625 \r\nQ 44.046875 -1.421875 31.78125 -1.421875 \r\nQ 19.53125 -1.421875 13.0625 8.265625 \r\nQ 6.59375 17.96875 6.59375 36.375 \r\nQ 6.59375 54.828125 13.0625 64.515625 \r\nQ 19.53125 74.21875 31.78125 74.21875 \r\nz\r\n\" id=\"DejaVuSans-48\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_2\">\r\n     <g id=\"line2d_3\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 81.680312 146.899219 \r\nL 81.680312 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_4\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"81.680312\" xlink:href=\"#m7b9e389e2e\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_2\">\r\n      <!-- 1 -->\r\n      <g transform=\"translate(78.499062 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 12.40625 8.296875 \r\nL 28.515625 8.296875 \r\nL 28.515625 63.921875 \r\nL 10.984375 60.40625 \r\nL 10.984375 69.390625 \r\nL 28.421875 72.90625 \r\nL 38.28125 72.90625 \r\nL 38.28125 8.296875 \r\nL 54.390625 8.296875 \r\nL 54.390625 0 \r\nL 12.40625 0 \r\nz\r\n\" id=\"DejaVuSans-49\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_3\">\r\n     <g id=\"line2d_5\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 120.740313 146.899219 \r\nL 120.740313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_6\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"120.740313\" xlink:href=\"#m7b9e389e2e\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_3\">\r\n      <!-- 2 -->\r\n      <g transform=\"translate(117.559062 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 19.1875 8.296875 \r\nL 53.609375 8.296875 \r\nL 53.609375 0 \r\nL 7.328125 0 \r\nL 7.328125 8.296875 \r\nQ 12.9375 14.109375 22.625 23.890625 \r\nQ 32.328125 33.6875 34.8125 36.53125 \r\nQ 39.546875 41.84375 41.421875 45.53125 \r\nQ 43.3125 49.21875 43.3125 52.78125 \r\nQ 43.3125 58.59375 39.234375 62.25 \r\nQ 35.15625 65.921875 28.609375 65.921875 \r\nQ 23.96875 65.921875 18.8125 64.3125 \r\nQ 13.671875 62.703125 7.8125 59.421875 \r\nL 7.8125 69.390625 \r\nQ 13.765625 71.78125 18.9375 73 \r\nQ 24.125 74.21875 28.421875 74.21875 \r\nQ 39.75 74.21875 46.484375 68.546875 \r\nQ 53.21875 62.890625 53.21875 53.421875 \r\nQ 53.21875 48.921875 51.53125 44.890625 \r\nQ 49.859375 40.875 45.40625 35.40625 \r\nQ 44.1875 33.984375 37.640625 27.21875 \r\nQ 31.109375 20.453125 19.1875 8.296875 \r\nz\r\n\" id=\"DejaVuSans-50\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_4\">\r\n     <g id=\"line2d_7\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 159.800313 146.899219 \r\nL 159.800313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_8\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"159.800313\" xlink:href=\"#m7b9e389e2e\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_4\">\r\n      <!-- 3 -->\r\n      <g transform=\"translate(156.619063 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 40.578125 39.3125 \r\nQ 47.65625 37.796875 51.625 33 \r\nQ 55.609375 28.21875 55.609375 21.1875 \r\nQ 55.609375 10.40625 48.1875 4.484375 \r\nQ 40.765625 -1.421875 27.09375 -1.421875 \r\nQ 22.515625 -1.421875 17.65625 -0.515625 \r\nQ 12.796875 0.390625 7.625 2.203125 \r\nL 7.625 11.71875 \r\nQ 11.71875 9.328125 16.59375 8.109375 \r\nQ 21.484375 6.890625 26.8125 6.890625 \r\nQ 36.078125 6.890625 40.9375 10.546875 \r\nQ 45.796875 14.203125 45.796875 21.1875 \r\nQ 45.796875 27.640625 41.28125 31.265625 \r\nQ 36.765625 34.90625 28.71875 34.90625 \r\nL 20.21875 34.90625 \r\nL 20.21875 43.015625 \r\nL 29.109375 43.015625 \r\nQ 36.375 43.015625 40.234375 45.921875 \r\nQ 44.09375 48.828125 44.09375 54.296875 \r\nQ 44.09375 59.90625 40.109375 62.90625 \r\nQ 36.140625 65.921875 28.71875 65.921875 \r\nQ 24.65625 65.921875 20.015625 65.03125 \r\nQ 15.375 64.15625 9.8125 62.3125 \r\nL 9.8125 71.09375 \r\nQ 15.4375 72.65625 20.34375 73.4375 \r\nQ 25.25 74.21875 29.59375 74.21875 \r\nQ 40.828125 74.21875 47.359375 69.109375 \r\nQ 53.90625 64.015625 53.90625 55.328125 \r\nQ 53.90625 49.265625 50.4375 45.09375 \r\nQ 46.96875 40.921875 40.578125 39.3125 \r\nz\r\n\" id=\"DejaVuSans-51\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-51\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_5\">\r\n     <g id=\"line2d_9\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 198.860313 146.899219 \r\nL 198.860313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_10\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"198.860313\" xlink:href=\"#m7b9e389e2e\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_5\">\r\n      <!-- 4 -->\r\n      <g transform=\"translate(195.679063 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 37.796875 64.3125 \r\nL 12.890625 25.390625 \r\nL 37.796875 25.390625 \r\nz\r\nM 35.203125 72.90625 \r\nL 47.609375 72.90625 \r\nL 47.609375 25.390625 \r\nL 58.015625 25.390625 \r\nL 58.015625 17.1875 \r\nL 47.609375 17.1875 \r\nL 47.609375 0 \r\nL 37.796875 0 \r\nL 37.796875 17.1875 \r\nL 4.890625 17.1875 \r\nL 4.890625 26.703125 \r\nz\r\n\" id=\"DejaVuSans-52\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_6\">\r\n     <g id=\"line2d_11\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 237.920313 146.899219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_12\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"237.920313\" xlink:href=\"#m7b9e389e2e\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_6\">\r\n      <!-- 5 -->\r\n      <g transform=\"translate(234.739063 161.497656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 10.796875 72.90625 \r\nL 49.515625 72.90625 \r\nL 49.515625 64.59375 \r\nL 19.828125 64.59375 \r\nL 19.828125 46.734375 \r\nQ 21.96875 47.46875 24.109375 47.828125 \r\nQ 26.265625 48.1875 28.421875 48.1875 \r\nQ 40.625 48.1875 47.75 41.5 \r\nQ 54.890625 34.8125 54.890625 23.390625 \r\nQ 54.890625 11.625 47.5625 5.09375 \r\nQ 40.234375 -1.421875 26.90625 -1.421875 \r\nQ 22.3125 -1.421875 17.546875 -0.640625 \r\nQ 12.796875 0.140625 7.71875 1.703125 \r\nL 7.71875 11.625 \r\nQ 12.109375 9.234375 16.796875 8.0625 \r\nQ 21.484375 6.890625 26.703125 6.890625 \r\nQ 35.15625 6.890625 40.078125 11.328125 \r\nQ 45.015625 15.765625 45.015625 23.390625 \r\nQ 45.015625 31 40.078125 35.4375 \r\nQ 35.15625 39.890625 26.703125 39.890625 \r\nQ 22.75 39.890625 18.8125 39.015625 \r\nQ 14.890625 38.140625 10.796875 36.28125 \r\nz\r\n\" id=\"DejaVuSans-53\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_7\">\r\n     <!-- x -->\r\n     <g transform=\"translate(137.310937 175.175781)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 54.890625 54.6875 \r\nL 35.109375 28.078125 \r\nL 55.90625 0 \r\nL 45.3125 0 \r\nL 29.390625 21.484375 \r\nL 13.484375 0 \r\nL 2.875 0 \r\nL 24.125 28.609375 \r\nL 4.6875 54.6875 \r\nL 15.28125 54.6875 \r\nL 29.78125 35.203125 \r\nL 44.28125 54.6875 \r\nz\r\n\" id=\"DejaVuSans-120\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-120\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"matplotlib.axis_2\">\r\n    <g id=\"ytick_1\">\r\n     <g id=\"line2d_13\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 42.620312 146.899219 \r\nL 237.920313 146.899219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_14\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL -3.5 0 \r\n\" id=\"mbd3d9f99bf\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbd3d9f99bf\" y=\"146.899219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_8\">\r\n      <!-- −1 -->\r\n      <g transform=\"translate(20.878125 150.698437)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 10.59375 35.5 \r\nL 73.1875 35.5 \r\nL 73.1875 27.203125 \r\nL 10.59375 27.203125 \r\nz\r\n\" id=\"DejaVuSans-8722\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-8722\"/>\r\n       <use x=\"83.789062\" xlink:href=\"#DejaVuSans-49\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_2\">\r\n     <g id=\"line2d_15\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 42.620312 124.249219 \r\nL 237.920313 124.249219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_16\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbd3d9f99bf\" y=\"124.249219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_9\">\r\n      <!-- 0 -->\r\n      <g transform=\"translate(29.257812 128.048437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_3\">\r\n     <g id=\"line2d_17\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 42.620312 101.599219 \r\nL 237.920313 101.599219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_18\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbd3d9f99bf\" y=\"101.599219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_10\">\r\n      <!-- 1 -->\r\n      <g transform=\"translate(29.257812 105.398437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_4\">\r\n     <g id=\"line2d_19\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 42.620312 78.949219 \r\nL 237.920313 78.949219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_20\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbd3d9f99bf\" y=\"78.949219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_11\">\r\n      <!-- 2 -->\r\n      <g transform=\"translate(29.257812 82.748437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_5\">\r\n     <g id=\"line2d_21\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 42.620312 56.299219 \r\nL 237.920313 56.299219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_22\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbd3d9f99bf\" y=\"56.299219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_12\">\r\n      <!-- 3 -->\r\n      <g transform=\"translate(29.257812 60.098437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-51\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_6\">\r\n     <g id=\"line2d_23\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 42.620312 33.649219 \r\nL 237.920313 33.649219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_24\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbd3d9f99bf\" y=\"33.649219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_13\">\r\n      <!-- 4 -->\r\n      <g transform=\"translate(29.257812 37.448437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_7\">\r\n     <g id=\"line2d_25\">\r\n      <path clip-path=\"url(#p972a843c2b)\" d=\"M 42.620312 10.999219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#b0b0b0;stroke-linecap:square;stroke-width:0.8;\"/>\r\n     </g>\r\n     <g id=\"line2d_26\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"42.620312\" xlink:href=\"#mbd3d9f99bf\" y=\"10.999219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_14\">\r\n      <!-- 5 -->\r\n      <g transform=\"translate(29.257812 14.798437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_15\">\r\n     <!-- y -->\r\n     <g transform=\"translate(14.798437 81.908594)rotate(-90)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 32.171875 -5.078125 \r\nQ 28.375 -14.84375 24.75 -17.8125 \r\nQ 21.140625 -20.796875 15.09375 -20.796875 \r\nL 7.90625 -20.796875 \r\nL 7.90625 -13.28125 \r\nL 13.1875 -13.28125 \r\nQ 16.890625 -13.28125 18.9375 -11.515625 \r\nQ 21 -9.765625 23.484375 -3.21875 \r\nL 25.09375 0.875 \r\nL 2.984375 54.6875 \r\nL 12.5 54.6875 \r\nL 29.59375 11.921875 \r\nL 46.6875 54.6875 \r\nL 56.203125 54.6875 \r\nz\r\n\" id=\"DejaVuSans-121\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-121\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"line2d_27\">\r\n    <path clip-path=\"url(#p972a843c2b)\" d=\"M 42.620312 124.249219 \r\nL 46.526313 116.136982 \r\nL 50.432313 108.999323 \r\nL 54.338313 102.217148 \r\nL 58.244313 95.726379 \r\nL 62.150312 89.522233 \r\nL 66.056313 83.619087 \r\nL 69.962312 78.038824 \r\nL 73.868313 72.806 \r\nL 77.774314 67.945395 \r\nL 81.680312 63.480584 \r\nL 85.586313 59.432954 \r\nL 89.492314 55.821098 \r\nL 93.398311 52.660258 \r\nL 97.304312 49.962036 \r\nL 101.210313 47.734078 \r\nL 105.116313 45.979911 \r\nL 109.022314 44.69881 \r\nL 112.928315 43.885737 \r\nL 116.834312 43.531371 \r\nL 120.740313 43.622105 \r\nL 124.646309 44.140188 \r\nL 128.552314 45.063873 \r\nL 132.458311 46.367563 \r\nL 136.364316 48.022135 \r\nL 140.270312 49.995107 \r\nL 144.176318 52.251038 \r\nL 148.082314 54.751808 \r\nL 151.98832 57.457039 \r\nL 155.894316 60.324422 \r\nL 159.800313 63.310193 \r\nL 163.706318 66.369546 \r\nL 167.612314 69.45704 \r\nL 171.518311 72.527086 \r\nL 175.424316 75.534393 \r\nL 179.330312 78.434371 \r\nL 183.236318 81.183652 \r\nL 187.142314 83.740416 \r\nL 191.048311 86.06491 \r\nL 194.954316 88.119776 \r\nL 198.860313 89.870412 \r\nL 202.766309 91.285368 \r\nL 206.672305 92.336626 \r\nL 210.57832 92.999866 \r\nL 214.484316 93.254719 \r\nL 218.390312 93.084986 \r\nL 222.296309 92.478756 \r\nL 226.202305 91.428572 \r\nL 230.10832 89.931453 \r\nL 234.014316 87.988973 \r\n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n   </g>\r\n   <g id=\"line2d_28\">\r\n    <path clip-path=\"url(#p972a843c2b)\" d=\"M 42.620312 111.962444 \r\nL 46.526313 108.292669 \r\nL 50.432313 99.860139 \r\nL 54.338313 97.94146 \r\nL 58.244313 93.696141 \r\nL 62.150312 88.423293 \r\nL 66.056313 76.95201 \r\nL 69.962312 55.505187 \r\nL 73.868313 68.636407 \r\nL 77.774314 69.454059 \r\nL 81.680312 69.45394 \r\nL 85.586313 66.388004 \r\nL 89.492314 63.010747 \r\nL 93.398311 38.140495 \r\nL 97.304312 55.265052 \r\nL 101.210313 54.355823 \r\nL 105.116313 54.884917 \r\nL 109.022314 41.074818 \r\nL 112.928315 37.709744 \r\nL 116.834312 38.583764 \r\nL 120.740313 38.612622 \r\nL 124.646309 62.314351 \r\nL 128.552314 56.095211 \r\nL 132.458311 43.425074 \r\nL 136.364316 38.236051 \r\nL 140.270312 38.226261 \r\nL 144.176318 69.923357 \r\nL 148.082314 68.586364 \r\nL 151.98832 61.653271 \r\nL 155.894316 58.538868 \r\nL 159.800313 66.827616 \r\nL 163.706318 53.102598 \r\nL 167.612314 63.654368 \r\nL 171.518311 63.170922 \r\nL 175.424316 57.389688 \r\nL 179.330312 57.391459 \r\nL 183.236318 69.671028 \r\nL 187.142314 72.446861 \r\nL 191.048311 74.912589 \r\nL 194.954316 106.839554 \r\nL 198.860313 106.93506 \r\nL 202.766309 108.271967 \r\nL 206.672305 90.343379 \r\nL 210.57832 90.74269 \r\nL 214.484316 75.572469 \r\nL 218.390312 82.566711 \r\nL 222.296309 101.861821 \r\nL 226.202305 91.829452 \r\nL 230.10832 101.121584 \r\nL 234.014316 77.445414 \r\n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\r\n   </g>\r\n   <g id=\"line2d_29\">\r\n    <defs>\r\n     <path d=\"M 0 3 \r\nC 0.795609 3 1.55874 2.683901 2.12132 2.12132 \r\nC 2.683901 1.55874 3 0.795609 3 0 \r\nC 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \r\nC 1.55874 -2.683901 0.795609 -3 0 -3 \r\nC -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \r\nC -2.683901 -1.55874 -3 -0.795609 -3 0 \r\nC -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \r\nC -1.55874 2.683901 -0.795609 3 0 3 \r\nz\r\n\" id=\"me49f16790e\" style=\"stroke:#ff7f0e;stroke-opacity:0.5;\"/>\r\n    </defs>\r\n    <g clip-path=\"url(#p972a843c2b)\">\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"45.039303\" xlink:href=\"#me49f16790e\" y=\"111.971489\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"47.052496\" xlink:href=\"#me49f16790e\" y=\"107.404747\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"48.700005\" xlink:href=\"#me49f16790e\" y=\"103.464765\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"51.436416\" xlink:href=\"#me49f16790e\" y=\"101.229984\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"51.785907\" xlink:href=\"#me49f16790e\" y=\"97.763168\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"51.976025\" xlink:href=\"#me49f16790e\" y=\"97.146049\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"59.354316\" xlink:href=\"#me49f16790e\" y=\"94.452979\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"61.084335\" xlink:href=\"#me49f16790e\" y=\"77.17831\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"63.164905\" xlink:href=\"#me49f16790e\" y=\"80.396359\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"63.287471\" xlink:href=\"#me49f16790e\" y=\"109.545358\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"64.707158\" xlink:href=\"#me49f16790e\" y=\"84.941257\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"66.747369\" xlink:href=\"#me49f16790e\" y=\"71.223774\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"70.741614\" xlink:href=\"#me49f16790e\" y=\"55.309981\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"75.763089\" xlink:href=\"#me49f16790e\" y=\"69.454059\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"89.26767\" xlink:href=\"#me49f16790e\" y=\"66.389008\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"91.608912\" xlink:href=\"#me49f16790e\" y=\"38.085262\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"98.543175\" xlink:href=\"#me49f16790e\" y=\"67.204852\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"98.593911\" xlink:href=\"#me49f16790e\" y=\"42.613805\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"104.056196\" xlink:href=\"#me49f16790e\" y=\"54.983773\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"108.625447\" xlink:href=\"#me49f16790e\" y=\"39.928754\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"109.45497\" xlink:href=\"#me49f16790e\" y=\"47.600294\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"110.146237\" xlink:href=\"#me49f16790e\" y=\"32.358306\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"115.028057\" xlink:href=\"#me49f16790e\" y=\"38.583764\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"127.63259\" xlink:href=\"#me49f16790e\" y=\"62.314745\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"130.443775\" xlink:href=\"#me49f16790e\" y=\"34.809064\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"132.525017\" xlink:href=\"#me49f16790e\" y=\"44.808552\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"136.956823\" xlink:href=\"#me49f16790e\" y=\"38.226093\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"146.427311\" xlink:href=\"#me49f16790e\" y=\"69.931338\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"148.155577\" xlink:href=\"#me49f16790e\" y=\"68.895605\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"150.836757\" xlink:href=\"#me49f16790e\" y=\"47.116778\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"152.121397\" xlink:href=\"#me49f16790e\" y=\"69.856664\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"154.98315\" xlink:href=\"#me49f16790e\" y=\"52.704254\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"157.72042\" xlink:href=\"#me49f16790e\" y=\"76.517836\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"162.110422\" xlink:href=\"#me49f16790e\" y=\"51.543469\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"166.311126\" xlink:href=\"#me49f16790e\" y=\"63.6544\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"177.229216\" xlink:href=\"#me49f16790e\" y=\"57.389688\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"184.263324\" xlink:href=\"#me49f16790e\" y=\"60.912836\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"184.43002\" xlink:href=\"#me49f16790e\" y=\"80.021282\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"199.469843\" xlink:href=\"#me49f16790e\" y=\"106.839425\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"201.362299\" xlink:href=\"#me49f16790e\" y=\"108.297862\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"208.598026\" xlink:href=\"#me49f16790e\" y=\"90.090321\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"209.294574\" xlink:href=\"#me49f16790e\" y=\"91.543634\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"209.317707\" xlink:href=\"#me49f16790e\" y=\"90.190481\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"216.944285\" xlink:href=\"#me49f16790e\" y=\"75.569732\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"220.264107\" xlink:href=\"#me49f16790e\" y=\"95.765385\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"222.365427\" xlink:href=\"#me49f16790e\" y=\"103.217595\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"225.05186\" xlink:href=\"#me49f16790e\" y=\"89.35038\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"228.270249\" xlink:href=\"#me49f16790e\" y=\"101.122113\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"236.306192\" xlink:href=\"#me49f16790e\" y=\"77.025491\"/>\r\n     <use style=\"fill:#ff7f0e;fill-opacity:0.5;stroke:#ff7f0e;stroke-opacity:0.5;\" x=\"237.802973\" xlink:href=\"#me49f16790e\" y=\"102.938964\"/>\r\n    </g>\r\n   </g>\r\n   <g id=\"patch_3\">\r\n    <path d=\"M 42.620312 146.899219 \r\nL 42.620312 10.999219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_4\">\r\n    <path d=\"M 237.920313 146.899219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_5\">\r\n    <path d=\"M 42.620312 146.899219 \r\nL 237.920313 146.899219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_6\">\r\n    <path d=\"M 42.620312 10.999219 \r\nL 237.920313 10.999219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"legend_1\">\r\n    <g id=\"patch_7\">\r\n     <path d=\"M 173.58125 48.355469 \r\nL 230.920313 48.355469 \r\nQ 232.920313 48.355469 232.920313 46.355469 \r\nL 232.920313 17.999219 \r\nQ 232.920313 15.999219 230.920313 15.999219 \r\nL 173.58125 15.999219 \r\nQ 171.58125 15.999219 171.58125 17.999219 \r\nL 171.58125 46.355469 \r\nQ 171.58125 48.355469 173.58125 48.355469 \r\nz\r\n\" style=\"fill:#ffffff;opacity:0.8;stroke:#cccccc;stroke-linejoin:miter;\"/>\r\n    </g>\r\n    <g id=\"line2d_30\">\r\n     <path d=\"M 175.58125 24.097656 \r\nL 195.58125 24.097656 \r\n\" style=\"fill:none;stroke:#1f77b4;stroke-linecap:square;stroke-width:1.5;\"/>\r\n    </g>\r\n    <g id=\"line2d_31\"/>\r\n    <g id=\"text_16\">\r\n     <!-- Truth -->\r\n     <g transform=\"translate(203.58125 27.597656)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M -0.296875 72.90625 \r\nL 61.375 72.90625 \r\nL 61.375 64.59375 \r\nL 35.5 64.59375 \r\nL 35.5 0 \r\nL 25.59375 0 \r\nL 25.59375 64.59375 \r\nL -0.296875 64.59375 \r\nz\r\n\" id=\"DejaVuSans-84\"/>\r\n       <path d=\"M 41.109375 46.296875 \r\nQ 39.59375 47.171875 37.8125 47.578125 \r\nQ 36.03125 48 33.890625 48 \r\nQ 26.265625 48 22.1875 43.046875 \r\nQ 18.109375 38.09375 18.109375 28.8125 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 54.6875 \r\nL 18.109375 54.6875 \r\nL 18.109375 46.1875 \r\nQ 20.953125 51.171875 25.484375 53.578125 \r\nQ 30.03125 56 36.53125 56 \r\nQ 37.453125 56 38.578125 55.875 \r\nQ 39.703125 55.765625 41.0625 55.515625 \r\nz\r\n\" id=\"DejaVuSans-114\"/>\r\n       <path d=\"M 8.5 21.578125 \r\nL 8.5 54.6875 \r\nL 17.484375 54.6875 \r\nL 17.484375 21.921875 \r\nQ 17.484375 14.15625 20.5 10.265625 \r\nQ 23.53125 6.390625 29.59375 6.390625 \r\nQ 36.859375 6.390625 41.078125 11.03125 \r\nQ 45.3125 15.671875 45.3125 23.6875 \r\nL 45.3125 54.6875 \r\nL 54.296875 54.6875 \r\nL 54.296875 0 \r\nL 45.3125 0 \r\nL 45.3125 8.40625 \r\nQ 42.046875 3.421875 37.71875 1 \r\nQ 33.40625 -1.421875 27.6875 -1.421875 \r\nQ 18.265625 -1.421875 13.375 4.4375 \r\nQ 8.5 10.296875 8.5 21.578125 \r\nz\r\nM 31.109375 56 \r\nz\r\n\" id=\"DejaVuSans-117\"/>\r\n       <path d=\"M 18.3125 70.21875 \r\nL 18.3125 54.6875 \r\nL 36.8125 54.6875 \r\nL 36.8125 47.703125 \r\nL 18.3125 47.703125 \r\nL 18.3125 18.015625 \r\nQ 18.3125 11.328125 20.140625 9.421875 \r\nQ 21.96875 7.515625 27.59375 7.515625 \r\nL 36.8125 7.515625 \r\nL 36.8125 0 \r\nL 27.59375 0 \r\nQ 17.1875 0 13.234375 3.875 \r\nQ 9.28125 7.765625 9.28125 18.015625 \r\nL 9.28125 47.703125 \r\nL 2.6875 47.703125 \r\nL 2.6875 54.6875 \r\nL 9.28125 54.6875 \r\nL 9.28125 70.21875 \r\nz\r\n\" id=\"DejaVuSans-116\"/>\r\n       <path d=\"M 54.890625 33.015625 \r\nL 54.890625 0 \r\nL 45.90625 0 \r\nL 45.90625 32.71875 \r\nQ 45.90625 40.484375 42.875 44.328125 \r\nQ 39.84375 48.1875 33.796875 48.1875 \r\nQ 26.515625 48.1875 22.3125 43.546875 \r\nQ 18.109375 38.921875 18.109375 30.90625 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 75.984375 \r\nL 18.109375 75.984375 \r\nL 18.109375 46.1875 \r\nQ 21.34375 51.125 25.703125 53.5625 \r\nQ 30.078125 56 35.796875 56 \r\nQ 45.21875 56 50.046875 50.171875 \r\nQ 54.890625 44.34375 54.890625 33.015625 \r\nz\r\n\" id=\"DejaVuSans-104\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-84\"/>\r\n      <use x=\"46.333984\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"87.447266\" xlink:href=\"#DejaVuSans-117\"/>\r\n      <use x=\"150.826172\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"190.035156\" xlink:href=\"#DejaVuSans-104\"/>\r\n     </g>\r\n    </g>\r\n    <g id=\"line2d_32\">\r\n     <path d=\"M 175.58125 38.775781 \r\nL 195.58125 38.775781 \r\n\" style=\"fill:none;stroke:#bf00bf;stroke-dasharray:5.55,2.4;stroke-dashoffset:0;stroke-width:1.5;\"/>\r\n    </g>\r\n    <g id=\"line2d_33\"/>\r\n    <g id=\"text_17\">\r\n     <!-- Pred -->\r\n     <g transform=\"translate(203.58125 42.275781)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 19.671875 64.796875 \r\nL 19.671875 37.40625 \r\nL 32.078125 37.40625 \r\nQ 38.96875 37.40625 42.71875 40.96875 \r\nQ 46.484375 44.53125 46.484375 51.125 \r\nQ 46.484375 57.671875 42.71875 61.234375 \r\nQ 38.96875 64.796875 32.078125 64.796875 \r\nz\r\nM 9.8125 72.90625 \r\nL 32.078125 72.90625 \r\nQ 44.34375 72.90625 50.609375 67.359375 \r\nQ 56.890625 61.8125 56.890625 51.125 \r\nQ 56.890625 40.328125 50.609375 34.8125 \r\nQ 44.34375 29.296875 32.078125 29.296875 \r\nL 19.671875 29.296875 \r\nL 19.671875 0 \r\nL 9.8125 0 \r\nz\r\n\" id=\"DejaVuSans-80\"/>\r\n       <path d=\"M 56.203125 29.59375 \r\nL 56.203125 25.203125 \r\nL 14.890625 25.203125 \r\nQ 15.484375 15.921875 20.484375 11.0625 \r\nQ 25.484375 6.203125 34.421875 6.203125 \r\nQ 39.59375 6.203125 44.453125 7.46875 \r\nQ 49.3125 8.734375 54.109375 11.28125 \r\nL 54.109375 2.78125 \r\nQ 49.265625 0.734375 44.1875 -0.34375 \r\nQ 39.109375 -1.421875 33.890625 -1.421875 \r\nQ 20.796875 -1.421875 13.15625 6.1875 \r\nQ 5.515625 13.8125 5.515625 26.8125 \r\nQ 5.515625 40.234375 12.765625 48.109375 \r\nQ 20.015625 56 32.328125 56 \r\nQ 43.359375 56 49.78125 48.890625 \r\nQ 56.203125 41.796875 56.203125 29.59375 \r\nz\r\nM 47.21875 32.234375 \r\nQ 47.125 39.59375 43.09375 43.984375 \r\nQ 39.0625 48.390625 32.421875 48.390625 \r\nQ 24.90625 48.390625 20.390625 44.140625 \r\nQ 15.875 39.890625 15.1875 32.171875 \r\nz\r\n\" id=\"DejaVuSans-101\"/>\r\n       <path d=\"M 45.40625 46.390625 \r\nL 45.40625 75.984375 \r\nL 54.390625 75.984375 \r\nL 54.390625 0 \r\nL 45.40625 0 \r\nL 45.40625 8.203125 \r\nQ 42.578125 3.328125 38.25 0.953125 \r\nQ 33.9375 -1.421875 27.875 -1.421875 \r\nQ 17.96875 -1.421875 11.734375 6.484375 \r\nQ 5.515625 14.40625 5.515625 27.296875 \r\nQ 5.515625 40.1875 11.734375 48.09375 \r\nQ 17.96875 56 27.875 56 \r\nQ 33.9375 56 38.25 53.625 \r\nQ 42.578125 51.265625 45.40625 46.390625 \r\nz\r\nM 14.796875 27.296875 \r\nQ 14.796875 17.390625 18.875 11.75 \r\nQ 22.953125 6.109375 30.078125 6.109375 \r\nQ 37.203125 6.109375 41.296875 11.75 \r\nQ 45.40625 17.390625 45.40625 27.296875 \r\nQ 45.40625 37.203125 41.296875 42.84375 \r\nQ 37.203125 48.484375 30.078125 48.484375 \r\nQ 22.953125 48.484375 18.875 42.84375 \r\nQ 14.796875 37.203125 14.796875 27.296875 \r\nz\r\n\" id=\"DejaVuSans-100\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-80\"/>\r\n      <use x=\"58.552734\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"97.416016\" xlink:href=\"#DejaVuSans-101\"/>\r\n      <use x=\"158.939453\" xlink:href=\"#DejaVuSans-100\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n  </g>\r\n </g>\r\n <defs>\r\n  <clipPath id=\"p972a843c2b\">\r\n   <rect height=\"135.9\" width=\"195.3\" x=\"42.620312\" y=\"10.999219\"/>\r\n  </clipPath>\r\n </defs>\r\n</svg>\r\n",
      "text/plain": [
       "<Figure size 252x180 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# `keys` 的形状: (`n_test`, `n_train`), 每一行包含着相同的训练输入（例如：相同的键）\n",
    "keys = x_train.repeat((n_test, 1))\n",
    "# `value` 的形状: (`n_test`, `n_train`)\n",
    "values = y_train.repeat((n_test, 1))\n",
    "y_hat = net(x_test, keys, values).unsqueeze(1).detach()\n",
    "\n",
    "print(y_hat.shape)\n",
    "\n",
    "plot_kernel_reg(y_hat)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.Size([1, 1, 50, 50])\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"159.039469pt\" version=\"1.1\" viewBox=\"0 0 199.72075 159.039469\" width=\"199.72075pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n   <cc:Work>\r\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n    <dc:date>2021-11-26T11:28:03.483515</dc:date>\r\n    <dc:format>image/svg+xml</dc:format>\r\n    <dc:creator>\r\n     <cc:Agent>\r\n      <dc:title>Matplotlib v3.3.4, https://matplotlib.org/</dc:title>\r\n     </cc:Agent>\r\n    </dc:creator>\r\n   </cc:Work>\r\n  </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n  <g id=\"patch_1\">\r\n   <path d=\"M 0 159.039469 \r\nL 199.72075 159.039469 \r\nL 199.72075 0 \r\nL 0 0 \r\nz\r\n\" style=\"fill:none;\"/>\r\n  </g>\r\n  <g id=\"axes_1\">\r\n   <g id=\"patch_2\">\r\n    <path d=\"M 40.603125 121.483219 \r\nL 152.203125 121.483219 \r\nL 152.203125 9.883219 \r\nL 40.603125 9.883219 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n   </g>\r\n   <g clip-path=\"url(#p9ba30b4f57)\">\r\n    <image height=\"112\" id=\"imagef7a48d041e\" transform=\"scale(1 -1)translate(0 -112)\" width=\"112\" x=\"40.603125\" xlink:href=\"data:image/png;base64,\r\n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\" y=\"-9.483219\"/>\r\n   </g>\r\n   <g id=\"matplotlib.axis_1\">\r\n    <g id=\"xtick_1\">\r\n     <g id=\"line2d_1\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL 0 3.5 \r\n\" id=\"m62a6bf6620\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"41.719125\" xlink:href=\"#m62a6bf6620\" y=\"121.483219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_1\">\r\n      <!-- 0 -->\r\n      <g transform=\"translate(38.537875 136.081656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 31.78125 66.40625 \r\nQ 24.171875 66.40625 20.328125 58.90625 \r\nQ 16.5 51.421875 16.5 36.375 \r\nQ 16.5 21.390625 20.328125 13.890625 \r\nQ 24.171875 6.390625 31.78125 6.390625 \r\nQ 39.453125 6.390625 43.28125 13.890625 \r\nQ 47.125 21.390625 47.125 36.375 \r\nQ 47.125 51.421875 43.28125 58.90625 \r\nQ 39.453125 66.40625 31.78125 66.40625 \r\nz\r\nM 31.78125 74.21875 \r\nQ 44.046875 74.21875 50.515625 64.515625 \r\nQ 56.984375 54.828125 56.984375 36.375 \r\nQ 56.984375 17.96875 50.515625 8.265625 \r\nQ 44.046875 -1.421875 31.78125 -1.421875 \r\nQ 19.53125 -1.421875 13.0625 8.265625 \r\nQ 6.59375 17.96875 6.59375 36.375 \r\nQ 6.59375 54.828125 13.0625 64.515625 \r\nQ 19.53125 74.21875 31.78125 74.21875 \r\nz\r\n\" id=\"DejaVuSans-48\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_2\">\r\n     <g id=\"line2d_2\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"86.359125\" xlink:href=\"#m62a6bf6620\" y=\"121.483219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_2\">\r\n      <!-- 20 -->\r\n      <g transform=\"translate(79.996625 136.081656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 19.1875 8.296875 \r\nL 53.609375 8.296875 \r\nL 53.609375 0 \r\nL 7.328125 0 \r\nL 7.328125 8.296875 \r\nQ 12.9375 14.109375 22.625 23.890625 \r\nQ 32.328125 33.6875 34.8125 36.53125 \r\nQ 39.546875 41.84375 41.421875 45.53125 \r\nQ 43.3125 49.21875 43.3125 52.78125 \r\nQ 43.3125 58.59375 39.234375 62.25 \r\nQ 35.15625 65.921875 28.609375 65.921875 \r\nQ 23.96875 65.921875 18.8125 64.3125 \r\nQ 13.671875 62.703125 7.8125 59.421875 \r\nL 7.8125 69.390625 \r\nQ 13.765625 71.78125 18.9375 73 \r\nQ 24.125 74.21875 28.421875 74.21875 \r\nQ 39.75 74.21875 46.484375 68.546875 \r\nQ 53.21875 62.890625 53.21875 53.421875 \r\nQ 53.21875 48.921875 51.53125 44.890625 \r\nQ 49.859375 40.875 45.40625 35.40625 \r\nQ 44.1875 33.984375 37.640625 27.21875 \r\nQ 31.109375 20.453125 19.1875 8.296875 \r\nz\r\n\" id=\"DejaVuSans-50\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"xtick_3\">\r\n     <g id=\"line2d_3\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"130.999125\" xlink:href=\"#m62a6bf6620\" y=\"121.483219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_3\">\r\n      <!-- 40 -->\r\n      <g transform=\"translate(124.636625 136.081656)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 37.796875 64.3125 \r\nL 12.890625 25.390625 \r\nL 37.796875 25.390625 \r\nz\r\nM 35.203125 72.90625 \r\nL 47.609375 72.90625 \r\nL 47.609375 25.390625 \r\nL 58.015625 25.390625 \r\nL 58.015625 17.1875 \r\nL 47.609375 17.1875 \r\nL 47.609375 0 \r\nL 37.796875 0 \r\nL 37.796875 17.1875 \r\nL 4.890625 17.1875 \r\nL 4.890625 26.703125 \r\nz\r\n\" id=\"DejaVuSans-52\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_4\">\r\n     <!-- Sorted training inputs -->\r\n     <g transform=\"translate(41.889844 149.759781)scale(0.1 -0.1)\">\r\n      <defs>\r\n       <path d=\"M 53.515625 70.515625 \r\nL 53.515625 60.890625 \r\nQ 47.90625 63.578125 42.921875 64.890625 \r\nQ 37.9375 66.21875 33.296875 66.21875 \r\nQ 25.25 66.21875 20.875 63.09375 \r\nQ 16.5 59.96875 16.5 54.203125 \r\nQ 16.5 49.359375 19.40625 46.890625 \r\nQ 22.3125 44.4375 30.421875 42.921875 \r\nL 36.375 41.703125 \r\nQ 47.40625 39.59375 52.65625 34.296875 \r\nQ 57.90625 29 57.90625 20.125 \r\nQ 57.90625 9.515625 50.796875 4.046875 \r\nQ 43.703125 -1.421875 29.984375 -1.421875 \r\nQ 24.8125 -1.421875 18.96875 -0.25 \r\nQ 13.140625 0.921875 6.890625 3.21875 \r\nL 6.890625 13.375 \r\nQ 12.890625 10.015625 18.65625 8.296875 \r\nQ 24.421875 6.59375 29.984375 6.59375 \r\nQ 38.421875 6.59375 43.015625 9.90625 \r\nQ 47.609375 13.234375 47.609375 19.390625 \r\nQ 47.609375 24.75 44.3125 27.78125 \r\nQ 41.015625 30.8125 33.5 32.328125 \r\nL 27.484375 33.5 \r\nQ 16.453125 35.6875 11.515625 40.375 \r\nQ 6.59375 45.0625 6.59375 53.421875 \r\nQ 6.59375 63.09375 13.40625 68.65625 \r\nQ 20.21875 74.21875 32.171875 74.21875 \r\nQ 37.3125 74.21875 42.625 73.28125 \r\nQ 47.953125 72.359375 53.515625 70.515625 \r\nz\r\n\" id=\"DejaVuSans-83\"/>\r\n       <path d=\"M 30.609375 48.390625 \r\nQ 23.390625 48.390625 19.1875 42.75 \r\nQ 14.984375 37.109375 14.984375 27.296875 \r\nQ 14.984375 17.484375 19.15625 11.84375 \r\nQ 23.34375 6.203125 30.609375 6.203125 \r\nQ 37.796875 6.203125 41.984375 11.859375 \r\nQ 46.1875 17.53125 46.1875 27.296875 \r\nQ 46.1875 37.015625 41.984375 42.703125 \r\nQ 37.796875 48.390625 30.609375 48.390625 \r\nz\r\nM 30.609375 56 \r\nQ 42.328125 56 49.015625 48.375 \r\nQ 55.71875 40.765625 55.71875 27.296875 \r\nQ 55.71875 13.875 49.015625 6.21875 \r\nQ 42.328125 -1.421875 30.609375 -1.421875 \r\nQ 18.84375 -1.421875 12.171875 6.21875 \r\nQ 5.515625 13.875 5.515625 27.296875 \r\nQ 5.515625 40.765625 12.171875 48.375 \r\nQ 18.84375 56 30.609375 56 \r\nz\r\n\" id=\"DejaVuSans-111\"/>\r\n       <path d=\"M 41.109375 46.296875 \r\nQ 39.59375 47.171875 37.8125 47.578125 \r\nQ 36.03125 48 33.890625 48 \r\nQ 26.265625 48 22.1875 43.046875 \r\nQ 18.109375 38.09375 18.109375 28.8125 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 54.6875 \r\nL 18.109375 54.6875 \r\nL 18.109375 46.1875 \r\nQ 20.953125 51.171875 25.484375 53.578125 \r\nQ 30.03125 56 36.53125 56 \r\nQ 37.453125 56 38.578125 55.875 \r\nQ 39.703125 55.765625 41.0625 55.515625 \r\nz\r\n\" id=\"DejaVuSans-114\"/>\r\n       <path d=\"M 18.3125 70.21875 \r\nL 18.3125 54.6875 \r\nL 36.8125 54.6875 \r\nL 36.8125 47.703125 \r\nL 18.3125 47.703125 \r\nL 18.3125 18.015625 \r\nQ 18.3125 11.328125 20.140625 9.421875 \r\nQ 21.96875 7.515625 27.59375 7.515625 \r\nL 36.8125 7.515625 \r\nL 36.8125 0 \r\nL 27.59375 0 \r\nQ 17.1875 0 13.234375 3.875 \r\nQ 9.28125 7.765625 9.28125 18.015625 \r\nL 9.28125 47.703125 \r\nL 2.6875 47.703125 \r\nL 2.6875 54.6875 \r\nL 9.28125 54.6875 \r\nL 9.28125 70.21875 \r\nz\r\n\" id=\"DejaVuSans-116\"/>\r\n       <path d=\"M 56.203125 29.59375 \r\nL 56.203125 25.203125 \r\nL 14.890625 25.203125 \r\nQ 15.484375 15.921875 20.484375 11.0625 \r\nQ 25.484375 6.203125 34.421875 6.203125 \r\nQ 39.59375 6.203125 44.453125 7.46875 \r\nQ 49.3125 8.734375 54.109375 11.28125 \r\nL 54.109375 2.78125 \r\nQ 49.265625 0.734375 44.1875 -0.34375 \r\nQ 39.109375 -1.421875 33.890625 -1.421875 \r\nQ 20.796875 -1.421875 13.15625 6.1875 \r\nQ 5.515625 13.8125 5.515625 26.8125 \r\nQ 5.515625 40.234375 12.765625 48.109375 \r\nQ 20.015625 56 32.328125 56 \r\nQ 43.359375 56 49.78125 48.890625 \r\nQ 56.203125 41.796875 56.203125 29.59375 \r\nz\r\nM 47.21875 32.234375 \r\nQ 47.125 39.59375 43.09375 43.984375 \r\nQ 39.0625 48.390625 32.421875 48.390625 \r\nQ 24.90625 48.390625 20.390625 44.140625 \r\nQ 15.875 39.890625 15.1875 32.171875 \r\nz\r\n\" id=\"DejaVuSans-101\"/>\r\n       <path d=\"M 45.40625 46.390625 \r\nL 45.40625 75.984375 \r\nL 54.390625 75.984375 \r\nL 54.390625 0 \r\nL 45.40625 0 \r\nL 45.40625 8.203125 \r\nQ 42.578125 3.328125 38.25 0.953125 \r\nQ 33.9375 -1.421875 27.875 -1.421875 \r\nQ 17.96875 -1.421875 11.734375 6.484375 \r\nQ 5.515625 14.40625 5.515625 27.296875 \r\nQ 5.515625 40.1875 11.734375 48.09375 \r\nQ 17.96875 56 27.875 56 \r\nQ 33.9375 56 38.25 53.625 \r\nQ 42.578125 51.265625 45.40625 46.390625 \r\nz\r\nM 14.796875 27.296875 \r\nQ 14.796875 17.390625 18.875 11.75 \r\nQ 22.953125 6.109375 30.078125 6.109375 \r\nQ 37.203125 6.109375 41.296875 11.75 \r\nQ 45.40625 17.390625 45.40625 27.296875 \r\nQ 45.40625 37.203125 41.296875 42.84375 \r\nQ 37.203125 48.484375 30.078125 48.484375 \r\nQ 22.953125 48.484375 18.875 42.84375 \r\nQ 14.796875 37.203125 14.796875 27.296875 \r\nz\r\n\" id=\"DejaVuSans-100\"/>\r\n       <path id=\"DejaVuSans-32\"/>\r\n       <path d=\"M 34.28125 27.484375 \r\nQ 23.390625 27.484375 19.1875 25 \r\nQ 14.984375 22.515625 14.984375 16.5 \r\nQ 14.984375 11.71875 18.140625 8.90625 \r\nQ 21.296875 6.109375 26.703125 6.109375 \r\nQ 34.1875 6.109375 38.703125 11.40625 \r\nQ 43.21875 16.703125 43.21875 25.484375 \r\nL 43.21875 27.484375 \r\nz\r\nM 52.203125 31.203125 \r\nL 52.203125 0 \r\nL 43.21875 0 \r\nL 43.21875 8.296875 \r\nQ 40.140625 3.328125 35.546875 0.953125 \r\nQ 30.953125 -1.421875 24.3125 -1.421875 \r\nQ 15.921875 -1.421875 10.953125 3.296875 \r\nQ 6 8.015625 6 15.921875 \r\nQ 6 25.140625 12.171875 29.828125 \r\nQ 18.359375 34.515625 30.609375 34.515625 \r\nL 43.21875 34.515625 \r\nL 43.21875 35.40625 \r\nQ 43.21875 41.609375 39.140625 45 \r\nQ 35.0625 48.390625 27.6875 48.390625 \r\nQ 23 48.390625 18.546875 47.265625 \r\nQ 14.109375 46.140625 10.015625 43.890625 \r\nL 10.015625 52.203125 \r\nQ 14.9375 54.109375 19.578125 55.046875 \r\nQ 24.21875 56 28.609375 56 \r\nQ 40.484375 56 46.34375 49.84375 \r\nQ 52.203125 43.703125 52.203125 31.203125 \r\nz\r\n\" id=\"DejaVuSans-97\"/>\r\n       <path d=\"M 9.421875 54.6875 \r\nL 18.40625 54.6875 \r\nL 18.40625 0 \r\nL 9.421875 0 \r\nz\r\nM 9.421875 75.984375 \r\nL 18.40625 75.984375 \r\nL 18.40625 64.59375 \r\nL 9.421875 64.59375 \r\nz\r\n\" id=\"DejaVuSans-105\"/>\r\n       <path d=\"M 54.890625 33.015625 \r\nL 54.890625 0 \r\nL 45.90625 0 \r\nL 45.90625 32.71875 \r\nQ 45.90625 40.484375 42.875 44.328125 \r\nQ 39.84375 48.1875 33.796875 48.1875 \r\nQ 26.515625 48.1875 22.3125 43.546875 \r\nQ 18.109375 38.921875 18.109375 30.90625 \r\nL 18.109375 0 \r\nL 9.078125 0 \r\nL 9.078125 54.6875 \r\nL 18.109375 54.6875 \r\nL 18.109375 46.1875 \r\nQ 21.34375 51.125 25.703125 53.5625 \r\nQ 30.078125 56 35.796875 56 \r\nQ 45.21875 56 50.046875 50.171875 \r\nQ 54.890625 44.34375 54.890625 33.015625 \r\nz\r\n\" id=\"DejaVuSans-110\"/>\r\n       <path d=\"M 45.40625 27.984375 \r\nQ 45.40625 37.75 41.375 43.109375 \r\nQ 37.359375 48.484375 30.078125 48.484375 \r\nQ 22.859375 48.484375 18.828125 43.109375 \r\nQ 14.796875 37.75 14.796875 27.984375 \r\nQ 14.796875 18.265625 18.828125 12.890625 \r\nQ 22.859375 7.515625 30.078125 7.515625 \r\nQ 37.359375 7.515625 41.375 12.890625 \r\nQ 45.40625 18.265625 45.40625 27.984375 \r\nz\r\nM 54.390625 6.78125 \r\nQ 54.390625 -7.171875 48.1875 -13.984375 \r\nQ 42 -20.796875 29.203125 -20.796875 \r\nQ 24.46875 -20.796875 20.265625 -20.09375 \r\nQ 16.0625 -19.390625 12.109375 -17.921875 \r\nL 12.109375 -9.1875 \r\nQ 16.0625 -11.328125 19.921875 -12.34375 \r\nQ 23.78125 -13.375 27.78125 -13.375 \r\nQ 36.625 -13.375 41.015625 -8.765625 \r\nQ 45.40625 -4.15625 45.40625 5.171875 \r\nL 45.40625 9.625 \r\nQ 42.625 4.78125 38.28125 2.390625 \r\nQ 33.9375 0 27.875 0 \r\nQ 17.828125 0 11.671875 7.65625 \r\nQ 5.515625 15.328125 5.515625 27.984375 \r\nQ 5.515625 40.671875 11.671875 48.328125 \r\nQ 17.828125 56 27.875 56 \r\nQ 33.9375 56 38.28125 53.609375 \r\nQ 42.625 51.21875 45.40625 46.390625 \r\nL 45.40625 54.6875 \r\nL 54.390625 54.6875 \r\nz\r\n\" id=\"DejaVuSans-103\"/>\r\n       <path d=\"M 18.109375 8.203125 \r\nL 18.109375 -20.796875 \r\nL 9.078125 -20.796875 \r\nL 9.078125 54.6875 \r\nL 18.109375 54.6875 \r\nL 18.109375 46.390625 \r\nQ 20.953125 51.265625 25.265625 53.625 \r\nQ 29.59375 56 35.59375 56 \r\nQ 45.5625 56 51.78125 48.09375 \r\nQ 58.015625 40.1875 58.015625 27.296875 \r\nQ 58.015625 14.40625 51.78125 6.484375 \r\nQ 45.5625 -1.421875 35.59375 -1.421875 \r\nQ 29.59375 -1.421875 25.265625 0.953125 \r\nQ 20.953125 3.328125 18.109375 8.203125 \r\nz\r\nM 48.6875 27.296875 \r\nQ 48.6875 37.203125 44.609375 42.84375 \r\nQ 40.53125 48.484375 33.40625 48.484375 \r\nQ 26.265625 48.484375 22.1875 42.84375 \r\nQ 18.109375 37.203125 18.109375 27.296875 \r\nQ 18.109375 17.390625 22.1875 11.75 \r\nQ 26.265625 6.109375 33.40625 6.109375 \r\nQ 40.53125 6.109375 44.609375 11.75 \r\nQ 48.6875 17.390625 48.6875 27.296875 \r\nz\r\n\" id=\"DejaVuSans-112\"/>\r\n       <path d=\"M 8.5 21.578125 \r\nL 8.5 54.6875 \r\nL 17.484375 54.6875 \r\nL 17.484375 21.921875 \r\nQ 17.484375 14.15625 20.5 10.265625 \r\nQ 23.53125 6.390625 29.59375 6.390625 \r\nQ 36.859375 6.390625 41.078125 11.03125 \r\nQ 45.3125 15.671875 45.3125 23.6875 \r\nL 45.3125 54.6875 \r\nL 54.296875 54.6875 \r\nL 54.296875 0 \r\nL 45.3125 0 \r\nL 45.3125 8.40625 \r\nQ 42.046875 3.421875 37.71875 1 \r\nQ 33.40625 -1.421875 27.6875 -1.421875 \r\nQ 18.265625 -1.421875 13.375 4.4375 \r\nQ 8.5 10.296875 8.5 21.578125 \r\nz\r\nM 31.109375 56 \r\nz\r\n\" id=\"DejaVuSans-117\"/>\r\n       <path d=\"M 44.28125 53.078125 \r\nL 44.28125 44.578125 \r\nQ 40.484375 46.53125 36.375 47.5 \r\nQ 32.28125 48.484375 27.875 48.484375 \r\nQ 21.1875 48.484375 17.84375 46.4375 \r\nQ 14.5 44.390625 14.5 40.28125 \r\nQ 14.5 37.15625 16.890625 35.375 \r\nQ 19.28125 33.59375 26.515625 31.984375 \r\nL 29.59375 31.296875 \r\nQ 39.15625 29.25 43.1875 25.515625 \r\nQ 47.21875 21.78125 47.21875 15.09375 \r\nQ 47.21875 7.46875 41.1875 3.015625 \r\nQ 35.15625 -1.421875 24.609375 -1.421875 \r\nQ 20.21875 -1.421875 15.453125 -0.5625 \r\nQ 10.6875 0.296875 5.421875 2 \r\nL 5.421875 11.28125 \r\nQ 10.40625 8.6875 15.234375 7.390625 \r\nQ 20.0625 6.109375 24.8125 6.109375 \r\nQ 31.15625 6.109375 34.5625 8.28125 \r\nQ 37.984375 10.453125 37.984375 14.40625 \r\nQ 37.984375 18.0625 35.515625 20.015625 \r\nQ 33.0625 21.96875 24.703125 23.78125 \r\nL 21.578125 24.515625 \r\nQ 13.234375 26.265625 9.515625 29.90625 \r\nQ 5.8125 33.546875 5.8125 39.890625 \r\nQ 5.8125 47.609375 11.28125 51.796875 \r\nQ 16.75 56 26.8125 56 \r\nQ 31.78125 56 36.171875 55.265625 \r\nQ 40.578125 54.546875 44.28125 53.078125 \r\nz\r\n\" id=\"DejaVuSans-115\"/>\r\n      </defs>\r\n      <use xlink:href=\"#DejaVuSans-83\"/>\r\n      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-111\"/>\r\n      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-101\"/>\r\n      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-100\"/>\r\n      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-32\"/>\r\n      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"442.089844\" xlink:href=\"#DejaVuSans-97\"/>\r\n      <use x=\"503.369141\" xlink:href=\"#DejaVuSans-105\"/>\r\n      <use x=\"531.152344\" xlink:href=\"#DejaVuSans-110\"/>\r\n      <use x=\"594.53125\" xlink:href=\"#DejaVuSans-105\"/>\r\n      <use x=\"622.314453\" xlink:href=\"#DejaVuSans-110\"/>\r\n      <use x=\"685.693359\" xlink:href=\"#DejaVuSans-103\"/>\r\n      <use x=\"749.169922\" xlink:href=\"#DejaVuSans-32\"/>\r\n      <use x=\"780.957031\" xlink:href=\"#DejaVuSans-105\"/>\r\n      <use x=\"808.740234\" xlink:href=\"#DejaVuSans-110\"/>\r\n      <use x=\"872.119141\" xlink:href=\"#DejaVuSans-112\"/>\r\n      <use x=\"935.595703\" xlink:href=\"#DejaVuSans-117\"/>\r\n      <use x=\"998.974609\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"1038.183594\" xlink:href=\"#DejaVuSans-115\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"matplotlib.axis_2\">\r\n    <g id=\"ytick_1\">\r\n     <g id=\"line2d_4\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL -3.5 0 \r\n\" id=\"me70d3f85e9\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#me70d3f85e9\" y=\"10.999219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_5\">\r\n      <!-- 0 -->\r\n      <g transform=\"translate(27.240625 14.798437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_2\">\r\n     <g id=\"line2d_5\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#me70d3f85e9\" y=\"33.319219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_6\">\r\n      <!-- 10 -->\r\n      <g transform=\"translate(20.878125 37.118437)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 12.40625 8.296875 \r\nL 28.515625 8.296875 \r\nL 28.515625 63.921875 \r\nL 10.984375 60.40625 \r\nL 10.984375 69.390625 \r\nL 28.421875 72.90625 \r\nL 38.28125 72.90625 \r\nL 38.28125 8.296875 \r\nL 54.390625 8.296875 \r\nL 54.390625 0 \r\nL 12.40625 0 \r\nz\r\n\" id=\"DejaVuSans-49\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_3\">\r\n     <g id=\"line2d_6\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#me70d3f85e9\" y=\"55.639219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_7\">\r\n      <!-- 20 -->\r\n      <g transform=\"translate(20.878125 59.438437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-50\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_4\">\r\n     <g id=\"line2d_7\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#me70d3f85e9\" y=\"77.959219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_8\">\r\n      <!-- 30 -->\r\n      <g transform=\"translate(20.878125 81.758437)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 40.578125 39.3125 \r\nQ 47.65625 37.796875 51.625 33 \r\nQ 55.609375 28.21875 55.609375 21.1875 \r\nQ 55.609375 10.40625 48.1875 4.484375 \r\nQ 40.765625 -1.421875 27.09375 -1.421875 \r\nQ 22.515625 -1.421875 17.65625 -0.515625 \r\nQ 12.796875 0.390625 7.625 2.203125 \r\nL 7.625 11.71875 \r\nQ 11.71875 9.328125 16.59375 8.109375 \r\nQ 21.484375 6.890625 26.8125 6.890625 \r\nQ 36.078125 6.890625 40.9375 10.546875 \r\nQ 45.796875 14.203125 45.796875 21.1875 \r\nQ 45.796875 27.640625 41.28125 31.265625 \r\nQ 36.765625 34.90625 28.71875 34.90625 \r\nL 20.21875 34.90625 \r\nL 20.21875 43.015625 \r\nL 29.109375 43.015625 \r\nQ 36.375 43.015625 40.234375 45.921875 \r\nQ 44.09375 48.828125 44.09375 54.296875 \r\nQ 44.09375 59.90625 40.109375 62.90625 \r\nQ 36.140625 65.921875 28.71875 65.921875 \r\nQ 24.65625 65.921875 20.015625 65.03125 \r\nQ 15.375 64.15625 9.8125 62.3125 \r\nL 9.8125 71.09375 \r\nQ 15.4375 72.65625 20.34375 73.4375 \r\nQ 25.25 74.21875 29.59375 74.21875 \r\nQ 40.828125 74.21875 47.359375 69.109375 \r\nQ 53.90625 64.015625 53.90625 55.328125 \r\nQ 53.90625 49.265625 50.4375 45.09375 \r\nQ 46.96875 40.921875 40.578125 39.3125 \r\nz\r\n\" id=\"DejaVuSans-51\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-51\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_5\">\r\n     <g id=\"line2d_8\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"40.603125\" xlink:href=\"#me70d3f85e9\" y=\"100.279219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_9\">\r\n      <!-- 40 -->\r\n      <g transform=\"translate(20.878125 104.078437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-52\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"text_10\">\r\n     <!-- Sorted testing inputs -->\r\n     <g transform=\"translate(14.798438 118.160562)rotate(-90)scale(0.1 -0.1)\">\r\n      <use xlink:href=\"#DejaVuSans-83\"/>\r\n      <use x=\"63.476562\" xlink:href=\"#DejaVuSans-111\"/>\r\n      <use x=\"124.658203\" xlink:href=\"#DejaVuSans-114\"/>\r\n      <use x=\"165.771484\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"204.980469\" xlink:href=\"#DejaVuSans-101\"/>\r\n      <use x=\"266.503906\" xlink:href=\"#DejaVuSans-100\"/>\r\n      <use x=\"329.980469\" xlink:href=\"#DejaVuSans-32\"/>\r\n      <use x=\"361.767578\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"400.976562\" xlink:href=\"#DejaVuSans-101\"/>\r\n      <use x=\"462.5\" xlink:href=\"#DejaVuSans-115\"/>\r\n      <use x=\"514.599609\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"553.808594\" xlink:href=\"#DejaVuSans-105\"/>\r\n      <use x=\"581.591797\" xlink:href=\"#DejaVuSans-110\"/>\r\n      <use x=\"644.970703\" xlink:href=\"#DejaVuSans-103\"/>\r\n      <use x=\"708.447266\" xlink:href=\"#DejaVuSans-32\"/>\r\n      <use x=\"740.234375\" xlink:href=\"#DejaVuSans-105\"/>\r\n      <use x=\"768.017578\" xlink:href=\"#DejaVuSans-110\"/>\r\n      <use x=\"831.396484\" xlink:href=\"#DejaVuSans-112\"/>\r\n      <use x=\"894.873047\" xlink:href=\"#DejaVuSans-117\"/>\r\n      <use x=\"958.251953\" xlink:href=\"#DejaVuSans-116\"/>\r\n      <use x=\"997.460938\" xlink:href=\"#DejaVuSans-115\"/>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"patch_3\">\r\n    <path d=\"M 40.603125 121.483219 \r\nL 40.603125 9.883219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_4\">\r\n    <path d=\"M 152.203125 121.483219 \r\nL 152.203125 9.883219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_5\">\r\n    <path d=\"M 40.603125 121.483219 \r\nL 152.203125 121.483219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n   <g id=\"patch_6\">\r\n    <path d=\"M 40.603125 9.883219 \r\nL 152.203125 9.883219 \r\n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n  </g>\r\n  <g id=\"axes_2\">\r\n   <g id=\"patch_7\">\r\n    <path clip-path=\"url(#p01a1ea5773)\" d=\"M 159.178125 106.453219 \r\nL 159.178125 106.134703 \r\nL 159.178125 25.231734 \r\nL 159.178125 24.913219 \r\nL 163.255125 24.913219 \r\nL 163.255125 25.231734 \r\nL 163.255125 106.134703 \r\nL 163.255125 106.453219 \r\nz\r\n\" style=\"fill:#ffffff;stroke:#ffffff;stroke-linejoin:miter;stroke-width:0.01;\"/>\r\n   </g>\r\n   <image height=\"81\" id=\"image060ae00f77\" transform=\"scale(1 -1)translate(0 -81)\" width=\"4\" x=\"159\" xlink:href=\"data:image/png;base64,\r\niVBORw0KGgoAAAANSUhEUgAAAAQAAABRCAYAAAD1sgc6AAAAnElEQVR4nJ2SOw7CUBADHxL3PykVFeyXFsaRLJFyNLY3UW77fOz5eu5n+gAMAYzVSJmIL1VQCdBY2Xwbw3eIsc1ISSTcika8QSB3BGf92/oVD1I+IX+HP0rZIcYGQXE25Q4HJscYWmrv6EJp9/6CahoFQyIppQTFSNuVGkaWswRFgNULQyNHDNchdwRPvzBQGmIQvKSUIHip3MHSD/5ryrXugEFNAAAAAElFTkSuQmCC\" y=\"-25\"/>\r\n   <g id=\"matplotlib.axis_3\"/>\r\n   <g id=\"matplotlib.axis_4\">\r\n    <g id=\"ytick_6\">\r\n     <g id=\"line2d_9\">\r\n      <defs>\r\n       <path d=\"M 0 0 \r\nL 3.5 0 \r\n\" id=\"m2ccaa27adf\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n      </defs>\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m2ccaa27adf\" y=\"106.453219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_11\">\r\n      <!-- 0.00 -->\r\n      <g transform=\"translate(170.255125 110.252437)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 10.6875 12.40625 \r\nL 21 12.40625 \r\nL 21 0 \r\nL 10.6875 0 \r\nz\r\n\" id=\"DejaVuSans-46\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_7\">\r\n     <g id=\"line2d_10\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m2ccaa27adf\" y=\"86.068219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_12\">\r\n      <!-- 0.25 -->\r\n      <g transform=\"translate(170.255125 89.867437)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 10.796875 72.90625 \r\nL 49.515625 72.90625 \r\nL 49.515625 64.59375 \r\nL 19.828125 64.59375 \r\nL 19.828125 46.734375 \r\nQ 21.96875 47.46875 24.109375 47.828125 \r\nQ 26.265625 48.1875 28.421875 48.1875 \r\nQ 40.625 48.1875 47.75 41.5 \r\nQ 54.890625 34.8125 54.890625 23.390625 \r\nQ 54.890625 11.625 47.5625 5.09375 \r\nQ 40.234375 -1.421875 26.90625 -1.421875 \r\nQ 22.3125 -1.421875 17.546875 -0.640625 \r\nQ 12.796875 0.140625 7.71875 1.703125 \r\nL 7.71875 11.625 \r\nQ 12.109375 9.234375 16.796875 8.0625 \r\nQ 21.484375 6.890625 26.703125 6.890625 \r\nQ 35.15625 6.890625 40.078125 11.328125 \r\nQ 45.015625 15.765625 45.015625 23.390625 \r\nQ 45.015625 31 40.078125 35.4375 \r\nQ 35.15625 39.890625 26.703125 39.890625 \r\nQ 22.75 39.890625 18.8125 39.015625 \r\nQ 14.890625 38.140625 10.796875 36.28125 \r\nz\r\n\" id=\"DejaVuSans-53\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-50\"/>\r\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_8\">\r\n     <g id=\"line2d_11\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m2ccaa27adf\" y=\"65.683219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_13\">\r\n      <!-- 0.50 -->\r\n      <g transform=\"translate(170.255125 69.482437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-53\"/>\r\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_9\">\r\n     <g id=\"line2d_12\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m2ccaa27adf\" y=\"45.298219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_14\">\r\n      <!-- 0.75 -->\r\n      <g transform=\"translate(170.255125 49.097437)scale(0.1 -0.1)\">\r\n       <defs>\r\n        <path d=\"M 8.203125 72.90625 \r\nL 55.078125 72.90625 \r\nL 55.078125 68.703125 \r\nL 28.609375 0 \r\nL 18.3125 0 \r\nL 43.21875 64.59375 \r\nL 8.203125 64.59375 \r\nz\r\n\" id=\"DejaVuSans-55\"/>\r\n       </defs>\r\n       <use xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-55\"/>\r\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-53\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n    <g id=\"ytick_10\">\r\n     <g id=\"line2d_13\">\r\n      <g>\r\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"163.255125\" xlink:href=\"#m2ccaa27adf\" y=\"24.913219\"/>\r\n      </g>\r\n     </g>\r\n     <g id=\"text_15\">\r\n      <!-- 1.00 -->\r\n      <g transform=\"translate(170.255125 28.712437)scale(0.1 -0.1)\">\r\n       <use xlink:href=\"#DejaVuSans-49\"/>\r\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\r\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\r\n       <use x=\"159.033203\" xlink:href=\"#DejaVuSans-48\"/>\r\n      </g>\r\n     </g>\r\n    </g>\r\n   </g>\r\n   <g id=\"patch_8\">\r\n    <path d=\"M 159.178125 106.453219 \r\nL 159.178125 106.134703 \r\nL 159.178125 25.231734 \r\nL 159.178125 24.913219 \r\nL 163.255125 24.913219 \r\nL 163.255125 25.231734 \r\nL 163.255125 106.134703 \r\nL 163.255125 106.453219 \r\nz\r\n\" style=\"fill:none;stroke:#000000;stroke-linejoin:miter;stroke-width:0.8;\"/>\r\n   </g>\r\n  </g>\r\n </g>\r\n <defs>\r\n  <clipPath id=\"p9ba30b4f57\">\r\n   <rect height=\"111.6\" width=\"111.6\" x=\"40.603125\" y=\"9.883219\"/>\r\n  </clipPath>\r\n  <clipPath id=\"p01a1ea5773\">\r\n   <rect height=\"81.54\" width=\"4.077\" x=\"159.178125\" y=\"24.913219\"/>\r\n  </clipPath>\r\n </defs>\r\n</svg>\r\n",
      "text/plain": [
       "<Figure size 180x180 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "print(net.attention_weights.unsqueeze(0).unsqueeze(0).shape)\n",
    "d2l.show_heatmaps(net.attention_weights.unsqueeze(0).unsqueeze(0),\n",
    "                  xlabel='Sorted training inputs',\n",
    "                  ylabel='Sorted testing inputs')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "pytorch_gpu",
   "language": "python",
   "name": "pytorch_gpu"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
